The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> 2 problems, opening a new window and code in field when accessed by a web browser
tudsy
post 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?
Attached File  page2.html ( 1.67k ) Number of downloads: 596
Attached File  Unsubscribe.html ( 1.61k ) Number of downloads: 529
Attached File  unsubscribe.php ( 1.86k ) Number of downloads: 533
Attached File  Sorrytoseeyougo.html ( 1.21k ) Number of downloads: 520
Attached Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Oct 19 2014, 05:53 AM
Post #2


.
********

Group: WDG Moderators
Posts: 9,653
Joined: 10-August 06
Member No.: 7



QUOTE(tudsy @ Oct 19 2014, 11:22 AM) *

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).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th April 2024 - 03:26 PM