| | |
Returning values from PHP file
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
•
•
Hi, I m new in this field. Actually I face a problem, I call a php file from a html file using javascript. I declare a variable in php file,I want to use this variable in the same html file after execution of php file.Please help.
Add .htaccess file to your directory
Inside the .htaccess file input :
PHP Syntax (Toggle Plain Text)
AddType application/x-httpd-php .html .htm AddHandler application/x-httpd-php .html .php .htm
This should allow you to use php in your .html files
If you're using JavaScript to call a PHP file, then it sounds like AJAX. In which case you would have to use the DOM to display the result of the PHP script. Please show us the script you're using.
"We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." - Robert Wilensky
•
•
Join Date: Sep 2008
Posts: 25
Reputation:
Solved Threads: 1
•
•
•
•
If you're using JavaScript to call a PHP file, then it sounds like AJAX. In which case you would have to use the DOM to display the result of the PHP script. Please show us the script you're using.
window.location.href = "loginCheck.php?idValue=" + idValue;
I use this code to pass a single value, how can i pass more than one value?
•
•
•
•
Thank Shanti. Can u explain how can i use hidden variable in php.
html Syntax (Toggle Plain Text)
b>TicTacToe</b><br> Enter Move X.<br> <pre> <form action="tictactoe.php" method="GET"> <input type="text" name="move" size=2> 0|x|2 <br> _|_|_ <br> 3|4|o <br> _|_|_ <br> 6|7|8 <br> </pre> <input type="hidden" name="board" value="0x234o678"> </form>
Last edited by Shanti Chepuru; Sep 19th, 2008 at 8:18 am.
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
•
•
Join Date: Sep 2008
Posts: 25
Reputation:
Solved Threads: 1
•
•
•
•
see this example:html Syntax (Toggle Plain Text)
b>TicTacToe</b><br> Enter Move X.<br> <pre> <form action="tictactoe.php" method="GET"> <input type="text" name="move" size=2> 0|x|2 <br> _|_|_ <br> 3|4|o <br> _|_|_ <br> 6|7|8 <br> </pre> <input type="hidden" name="board" value="0x234o678"> </form>
![]() |
Similar Threads
- PHP blog from flat file (PHP)
- Cold fusion do not support input param: Help (ColdFusion)
Other Threads in the PHP Forum
- Previous Thread: passing more than one values to php file
- Next Thread: Help for Newbie! Need to create a link to larger image target _blank in PHP
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array basic beginner binary broken cakephp checkbox class cms code computing cron curl database date delete directory display domain download dynamic echo email error file files folder form forms function functions google href htaccess html image include indentedsubcategory insert integration ip java javascript joomla limit link load login loop mail menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote return script search select server sessions sms soap source space speed sql structure syntax system table tutorial update upload url validation validator variable video web xml youtube






