0

I'm new to PHP.I'm trying to do something very simple,I have tried to search on google but still i'm not understanding why its not working. I'm trying to send information through a url, and having a script pick it up using the $_GET super global.

This is FORM.php script:

<form action="home.php" method="get"> Email:<input type="text" name="email"/> </form>

This is the home.php script:

<?php echo $_GET['email']; ?>

This yields a blank page.but URL is displaying that email has been sent. Thanks for taking the time to read through this!Any help will be appreciated.

6
Contributors
10
Replies
11
Views
5 Years
Discussion Span
Last Post by tyson567
0

try

print_r($_GET)

If it's empty, you should see Array().
Otherwise all url parameters and values should be shown.

0

<form action="home.php" method="get"> Email:<input type="text" name="email"/> </form>

also try adding id="email"

<form action="home.php" method="get"> Email:<input type="text" name="email" id="email"/> </form>

0

also try adding id="email"

That's not impt for form field submission. Useful for js/css though.

0

Actually your code is allright.

You should try the print_r($_GET) as diafol said

echo '<pre>'.print_r($_GET).'</pre>';
0

yes.its displaying url parameter and their values.

but still
echo $_GET['email'];
is not working.

when try this code with post , even that also not working.

0

so try adding id="email"

When i add id="email" its now working..Thank you!!

Edited by mits28

0

I'm getting it right even without 'id'...Don't know how it is possible for mits28 to get it only with 'id'?

Hey, Squidge can u explain why u suggested 'id'?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.