2 problems, opening a new window and code in field when accessed by a web browser |
2 problems, opening a new window and code in field when accessed by a web browser |
tudsy |
Oct 19 2014, 04:22 AM
Post
#1
|
Advanced Member Group: Members Posts: 246 Joined: 30-September 14 Member No.: 21,611 |
Hi
I have at the moment 2 problems: Problem 1. I have code appearing in the field when accessed in the browser. (page2.html) How do I get rid of the code to leave a blank field? Problem 2. I am trying to connect to a new url after an option is clicked. (Unsubscribe.html, unsubscribe.php, ecovib2d1.jpg, Sorrytoseeyougo.html) Can anyone assist me? page2.html ( 1.67k ) Number of downloads: 596 Unsubscribe.html ( 1.61k ) Number of downloads: 529 unsubscribe.php ( 1.86k ) Number of downloads: 533 Sorrytoseeyougo.html ( 1.21k ) Number of downloads: 520 |
Christian J |
Oct 19 2014, 05:53 AM
Post
#2
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
Problem 1. I have code appearing in the field when accessed in the browser. (page2.html) How do I get rid of the code to leave a blank field? Why did you put the PHP code there in the first place? Also the PHP variables in it are not defined anywhere, so it shouldn't work. QUOTE Problem 2. I am trying to connect to a new url after an option is clicked. Do you mean directly after clicking a radio button? That would require javascript. But I don't recommend that, since users do not expect such behavior. A simpler and maybe more intuitive way is to remove the radio buttons and use two submit buttons instead, each with a different NAME: CODE <input type="submit" name="male" value="Man"> <input type="submit" name="female" value="Woman"> Then you can use PHP's isset() function to find out which button was clicked: CODE if(isset($_POST['male'])) { $gender='male'; } (note that the button's NAME attribute is used for this, not the VALUE attribute). |
Lo-Fi Version | Time is now: 24th April 2024 - 05:43 PM |