MS excel sheet is not showing properly through ZOHO excel viewer - php

<form method="POST" action="https://sheet.zoho.com/remotedoc.im" target="_self" accept-charset="UTF-8">
File :
I tried the above and I get a response like below:
RESULT=TRUE
URL=https://sheet.zoho.com/editor.do?doc=c2826da1f9894a549f13cf1172e390a30cabeb061f45f393&lang=en
I want to see it inside a web browser using ZOHO sheet.

<form method="POST" action="https://sheet.zoho.com/remotedoc.im" target="_self" accept-charset="UTF-8">
File : <input type="file" name="content" size="38" value=""> <br>
<input type="hidden" name="apikey" value="a1a00a67760e39e2ecb8b1187d05271b">
<input type="hidden" name="output" value="url">
<input type="hidden" name="mode" value="normaledit">
<input type="hidden" name="filename" value="mydocument.doc">
<input type="hidden" name="lang" value="en">
<input type="hidden" name="id" value="22345678">
<input type="hidden" name="format" value="xlsx">
<input type="hidden" name="saveurl" value="">
<input type="submit" name="submit" value="Open/Edit">
</form>
This is the original form.After submit it, I can't view the excel sheet.

Related

Form action html to php

i have
<form action = "https://creator.zoho.com/api/xml/fileupload/scope=creatorapi&authtoken=**************" method="post" enctype="multipart/form-data">
<input type="text" name="applinkname" value="sample">
<input type="text" name="formname" value="Employee">
<input type="text" name="fieldname" value="File_upload">
<input type="text" name="recordId" value="1235667754455">
<input type="text" name="filename" value="profile.jpg" >
<input type="file" name="file">
<input type="submit" value="Update">
</form>
But i must send 2500 files, how can i transform this html to php, my problem is <input type="file" name="file">, how convert it to give a value in php ?
thanks you
You can use $_REQUEST['FILE']=$SOME VARIABLE;
And name is same what you use in your database
then apply enctype="multipart/form-data".

Double Get Send Data

In this page : page.php?id=value
I've this html's code:
<form action="" method="get">
<input type="text" name="key" />
<input type="submit" name="send />
</form>
It's redirect me to: page.php?key=value , i want to redirect to: page.php?id=value&key=value , how i can do it? I must redirect it to this page with PHP ?
simply,
<form action="page.php" method="get">
<input type="hidden" name="id" value="<?php echo $value ?>">
<input type="text" name="key" />
<input type="submit" name="send" />
</form>
You can have the id as a hidden input in your form
<form action="" method="get">
<input type="hidden" value="<?php echo $my_id; /*Suppose this variable contain your value */ ?>" name="id" />
<input type="text" name="key" />
<input type="submit" name="send" />
</form>
put everything you want on the next page in your form:
<form action="page.php" method="get">
<input type="text" name="id" value="<?php echo $_REQUEST['id'];?>" />
<input type="text" name="key" />
<input type="submit" name="send />
</form>
Really though, you should be using POST to send data, and the above code is NOT secure (allows anything in a url to easily end up in a form that could create some sql injection or XSS type issues.
You need to have the form's action set to the page you want it to submit to. If it is blank it will just submit to the same page.
<form action="page.php?id=value&key=value" method="get">
<input type="text" name="key" />
<input type="submit" name="send />
</form>

Add suffix to action url

I have this form
<form role="search" method="get" id="searchform" class="searchform" action="http://search.site.com/Archive/search/read" >
<div>
<input type="text" value="" placeholder="text" name="query" id="?" />
<input type="submit" id="searchsubmit" value="." />
</div>
</form>
I need to add this suffix at the end of the url: &title=&start_year=&end_year=
For example:
http://search.site.com/Archive/search/read?query=pertini&title=&start_year=&end_year=
Where the query is: pertini
Is it possible in JavaScript or jQuery or in PHP?
Site only support GET method.
I am working in WordPress.
Just add hidden fields for all the ones you need:
<form role="search" method="get" id="searchform" class="searchform" action="http://search.site.com/Archive/search/read">
<div>
<input type="text" value="" placeholder="text" name="query" id="?" /><input type="submit" id="searchsubmit" value="." />
</div>
<input name="title" type="hidden" value="" />
<input name="start_year" type="hidden" value="" />
<input name="end_year" type="hidden" value="" />
</form>

How to cancel all the div when the form is created CakePHP 2?

How to cancel all the div when the form is created?
The default:
<form action="/services/edit/1" class="vertical___" id="ServiceEditForm" method="post" accept-charset="utf-8"><div style="display:none;">
<input type="hidden" name="_method" value="PUT"></div> <fieldset>
<legend>Edit Service</legend>
<input type="hidden" name="data[Service][id]" value="1" id="ServiceId"><div class="input text required"><label for="ServiceName">Name</label><input name="data[Service][name]" maxlength="250" type="text" value="text-text" id="ServiceName"></div> </fieldset>
<div class="submit"><input type="submit" value="Submit"></div></form>
A must have:
<form action="/services/edit/1" class="vertical" id="ServiceEditForm" method="post" accept-charset="utf-8">
<input type="hidden" name="_method" value="PUT">
<fieldset>
<legend>Edit Service</legend>
<input type="hidden" name="data[Service][id]" value="1" id="ServiceId"><div class="input text required"><label for="ServiceName">Name</label>
<input name="data[Service][name]" maxlength="250" type="text" value="text-text" id="ServiceName"></div> </fieldset>
<input type="submit" value="Submit"></form>

Hold variables in php for submit

I have several html textareas on my site. Each has a submit button. When a user types in one of the textareas i need to know which textarea this is. These textareas are each assigned a number taken from a mysql database. I can get the numbers out of the database, but how can I make it so that when a user types in a textarea and clicks submit the submit form knows which textarea this is. Please ask to clarify if needed. I tried my best to explain the problem. thanks.
p.s. the submit button just performs a mysql set values query. I'm using php on my site.
for example: a textarea is assigned '3.' When i submit this form i need 3 to be sent into my mysql set values query.
Use a hidden input to store a reference for each form
<input type="hidden" name="database_reference" value="<?php echo $dbId; ?>" />
Then when you submit the form $_POST['database_reference'] gives you the database id.
<input type="hidden" value="5" name="which_one" />
so for example
<form method="post" action="">
<textearea name="text"></textarea>
<input type="hidden" value="1" name="which_one" />
<input type="button" />
</form>
<form method="post" action="">
<textearea name="text"></textarea>
<input type="hidden" value="2" name="which_one" />
<input type="button" />
</form>
<form method="post" action="">
<textearea name="text"></textarea>
<input type="hidden" value="3" name="which_one" />
<input type="button" />
</form>
<form method="post" action="">
<textearea name="text"></textarea>
<input type="hidden" value="4" name="which_one" />
<input type="button" />
</form>
<form method="post" action="">
<textearea name="text"></textarea>
<input type="hidden" value="5" name="which_one" />
<input type="button" />
</form>
UPDATE:
<?php
if ($_POST){
include("db_connection.php");
mysql_query("UPDATE table SET column = '".mysql_real_escape_string($_POST['text'])."' WHERE value = ".intval($_POST['value']));
echo "done";
}
?>
<form method="post" action="">
<textearea name="text"></textarea>
<input type="hidden" value="1" name="which_one" />
<input type="button" />
</form>
<form method="post" action="">
<textearea name="text"></textarea>
<input type="hidden" value="2" name="which_one" />
<input type="button" />
</form>
<form method="post" action="">
<textearea name="text"></textarea>
<input type="hidden" value="3" name="which_one" />
<input type="button" />
</form>
<form method="post" action="">
<textearea name="text"></textarea>
<input type="hidden" value="4" name="which_one" />
<input type="button" />
</form>
<form method="post" action="">
<textearea name="text"></textarea>
<input type="hidden" value="5" name="which_one" />
<input type="button" />
</form>
Assuming you have multiple <form></form> tags set up, one for each <textarea>, I would just add a hidden input field in each form. For example:
<form>
<textarea />
<input type="hidden" value="1" />
<input type="submit" />
</form>
<form>
<textarea />
<input type="hidden" value="2" />
<input type="submit" />
</form>
You can flesh it out from there, but you get the idea.

Categories