Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

PHP question

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

PHP question

Postby Alienz » Sun Feb 09, 2003 1:19 am

What is the code for PHP to open a link?
Alienz
New php-forum User
New php-forum User
 
Posts: 13
Joined: Wed Jan 29, 2003 8:24 am

Postby pootergeist » Sun Feb 09, 2003 2:28 am

a link (socket) to another server?

if not, what other sort of link would php (a solely serverside language) open?

... read above as 'please explain more'.
pootergeist
New php-forum User
New php-forum User
 
Posts: 191
Joined: Wed Jan 29, 2003 7:11 am
Location: UK

Postby Alienz » Sun Feb 09, 2003 2:36 am

For example, I thinking of making a form using radio type. To let user to choose which option they want then it will go to the .php file to check whether which option they had choosen then redirect them to certain link.

example of the code
<form action="try.php" method="post">
<input type="radio" name="x value="one" checked>One
<input type="radio" name="x" value="two">Two
<input type="submit">
</form>
Alienz
New php-forum User
New php-forum User
 
Posts: 13
Joined: Wed Jan 29, 2003 8:24 am

Postby Joan Garnet » Sun Feb 09, 2003 11:38 am

In try.php I would choose the page where now should be redirected using a conditional:

Code: Select all
switch ($HTTP_POST_VARS["x"]){
   case "one":
      header("Location: info.php");
   break;
   case "two":
      header("Location: index.php");
   break;
   case "three":
      header("Location: whatever.php");
   break;
}
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

Postby Alienz » Mon Feb 10, 2003 1:50 am

Thanks very much. I got it.
Alienz
New php-forum User
New php-forum User
 
Posts: 13
Joined: Wed Jan 29, 2003 8:24 am


Return to PHP coding => General

Who is online

Users browsing this forum: WebOutGateway and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.