FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


php + forms + variables





nunosilva
Hey guys,
I'm doing a small script that, in one file has a form to fill in, in the form code I've put the method as get and the action to open another file. when i submit values, the other link is like this:

blablabla.php?name=xpto

and i got on that php file the following:

echo "name: " , $name;


this is not working.... why's that?? thanks!
mathiaus
Global variables, nasty things.

Code:
$name = $_GET['name'];
echo "name: " , $name;


That should work Smile

Matt
nunosilva
that's exactly what I was looking for! it really worked!! lol it only had to work! thanks a lot!
anhstar
Ya heh! That happens alot when I was a noob to PHP. Nowday I use the $_GET or $_POST in any situation, just in case if a server has the GLOBAL VARIABLE turn off.
Related topics
php and mysql connection in flash based website
PHP Tutorials
Variaveis pre-definidas[php]
storing current page address as php variable
PHP Forms security
Urls into variables
Forumfinder
XML parsing
php enabled server with mail server
Need Help
Can a php page generate a file?
Using php to change content of a .txt
Create Web forms,Email forms,PHP forms for free
Online Database programme
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.