Page 1 of 1

PHP question

Posted: Sun Feb 09, 2003 1:19 am
by Alienz
What is the code for PHP to open a link?

Posted: Sun Feb 09, 2003 2:28 am
by pootergeist
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'.

Posted: Sun Feb 09, 2003 2:36 am
by Alienz
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>

Posted: Sun Feb 09, 2003 11:38 am
by Joan Garnet
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;
}

Posted: Mon Feb 10, 2003 1:50 am
by Alienz
Thanks very much. I got it.