Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

problem passing email addrss string from form using post method

Featured Replies

Hey guys,

 

I have a simple form which allows the user to enter an email address associated with there account into an input field. I'll show you the code:

 

Form code

<form name="email" method="post" action="retreivelogin.php">
Email: <input type="text" name="email" /><br />
<input type="submit" name="submit" value="Retreive login details" />

 

retrivelogin.php code

if(isset($_POST['submit'])){
$email = $_POST['email'];
print $email;
}

 

Now the problem bieng that the @ sign seems to be ruining it somehow... standrad text strings print out nicely as they should, where as email addresses don't. I have searched for hours for a solution but running low on time and need to get this working.

 

Thank you in advance

 

Jonathan Vickers

  • Author

Can you post a screen shot? it should be showing properly

 

Below is how i have it set out in the php file. I intend on adding some mysql and mail() functions to it but for now this doesnt even work. This is copied straight from the php file.

if(isset($_POST['submit'])){

$email = $_POST['email'];

if(strlen($email)>0){
	print $email;
}else{
        print 'Nothing has been entered<br /><br />';
}

}

print 'If you have already registered an email address with your account, enter that address below and your username and password will be sent to you immediately. Please delete the email once you have used it.<br /><br />';

print '<form name="email" method="post" action="retreivelogin.php">
Email: <input type="text" name="email" /><br />
<input type="submit" name="submit" value="Retreive login details" />';

 

thanks again

J. Vickers

  • Author

I actually meant of how it looks in your browser with the @ showing incorrectly

 

Ok, i was just making screen shots and i've realised that the problem isnt the @ sign. no wonder i could find any thing on it. It seems really random. i tried entering the string 'without' and it didnt do anything. but a rnadom set of letters such as 'sfsefse' does work and it is printed out as it should be. here is the link see to the form http://www.billinghamtrampolineclub.co.uk/retreivelogin.php ive programmed for a while now but have never had a weird problem like this. It will probably still come down to a silly little error.

  • Author

Ok, i was just making screen shots and i've realised that the problem isnt the @ sign. no wonder i could find any thing on it. It seems really random. i tried entering the string 'without' and it didnt do anything. but a rnadom set of letters such as 'sfsefse' does work and it is printed out as it should be. here is the link see to the form http://www.billinghamtrampolineclub.co.uk/retreivelogin.php ive programmed for a while now but have never had a weird problem like this. It will probably still come down to a silly little error.

 

and now it seems to be working :S argh ive not touched the code! what on earth is going on! possible host issues perhaps??

 

ignore that its not working again

Hi

Tried exactly the same code on my server with no problems.

 

What browser are you using. is it sending strange characters.

 

Try changing method="post" to method="GET" so you can see what is being sent in the querystring.

  • Author

Hi

Tried exactly the same code on my server with no problems.

 

What browser are you using. is it sending strange characters.

 

Try changing method="post" to method="GET" so you can see what is being sent in the querystring.

 

i've changed the method to GET, i'm wondering wether its something to do with the submit input on the form... take another look. When you get the string printed out it shows both the email string and the submit value in the url. When it doesnt work it doesnt show the submit value. So the isset($_GET['submit']) won't work so it prints the page out as normal. Think im on the right lines?

  • Author

i've changed the method to GET, i'm wondering wether its something to do with the submit input on the form... take another look. When you get the string printed out it shows both the email string and the submit value in the url. When it doesnt work it doesnt show the submit value. So the isset($_GET['submit']) won't work so it prints the page out as normal. Think im on the right lines?

 

and im using IE8 right now.

Just a thought, have you got a </form> tag because you don't show it in your code?

  • Author

Just a thought, have you got a </form> tag because you don't show it in your code?

 

HAHA! he's only gone and hit the nail bang on the head! Whoops, i knew it would be something silly. O well best get on with it! Cheers man :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.