 |
| Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

January 16th, 2005, 07:10 AM
|
|
Authorized User
|
|
Join Date: Jan 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Beggininng PHP
I have just started reading my first book of PHP. I have installed Apache 1.3 and PHP 4.3.10 (manual install). Apache works and PHPINFO command shows info of PHP in browser. But when I prepare the first form shown in the book the variable is not sent to the .php file. It is not shown in the browser in result. I don't know why it doesn't work.
The index.htm is:
<html>
<head></head>
<body>
<form action="text.php" method=get>
blablablabla
<input type="text" name="something">
<br>
<input type=submit>
</form>
</body>
</html>
and the text.php file is:
<html>
<body>
<?php
echo $something;
?>
</body>
</html>
In result I see only blablablabla in browser
Please, anyone tell me how to install PHP on apache.
Yo
__________________
Yo
|
|

January 16th, 2005, 11:26 AM
|
|
Authorized User
|
|
Join Date: Jan 2005
Posts: 82
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
for the form, do
method = POST
and in text.php
$something = $_POST['something'];
echo $something;
make sure they are in the same folder with the way you are pointing.
|
|

January 17th, 2005, 03:54 AM
|
|
Authorized User
|
|
Join Date: Jan 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Incredible, works. ther was no mention about this in the book. Thanks a lot.
Yo
|
|

January 17th, 2005, 04:52 AM
|
|
Authorized User
|
|
Join Date: Feb 2004
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
dear
may be ur book was published earlier infact after php 4
register globals directive is off that y u collect ur form
variable via $_get[] or $_post[] and when u r not sure u may
use $_request[] super global array or collection
|
|

January 17th, 2005, 09:39 AM
|
|
Authorized User
|
|
Join Date: Jan 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I see.
Yo
|
|

January 17th, 2005, 09:51 AM
|
|
Authorized User
|
|
Join Date: Jan 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
But how to change that, so that i wouldn't have to use $_POST all the time
Yo
|
|

January 18th, 2005, 07:19 AM
|
|
Authorized User
|
|
Join Date: Jan 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Is there any other way to set it globaly, maybe in PHP.INI ?
If there is not, how to define an array, defined in another .php.
Yo
|
|

January 18th, 2005, 05:45 PM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
It is generally a good practice not to use register_globals, but if you like you can go into php.ini and look for register_globals and turn it on.
-Snib - http://www.snibworks.com
Where will you be in 100 years?
|
|
 |