December 17, 200916 yr 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
December 17, 200916 yr 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
December 17, 200916 yr I actually meant of how it looks in your browser with the @ showing incorrectly
December 17, 200916 yr 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.
December 17, 200916 yr 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
December 17, 200916 yr 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.
December 17, 200916 yr 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?
December 17, 200916 yr 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.
December 17, 200916 yr Just a thought, have you got a </form> tag because you don't show it in your code?
December 18, 200916 yr 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