Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 25th, 2006, 04:16 AM
Authorized User
 
Join Date: Nov 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to connect to next php page...

i cannot go to the next page indicated in the header, can anyone help me... Is my command correct? thanks...

<?
session_start();
?>

<html>
<body>

<?php
$radiobutton = $_POST['radiobutton'];

if ($radiobutton=="rb1")
{
header ("location:rb1.php");
}
elseif ($radiobutton=="rb2")
{
header ("location:rb2.php");
}
elseif ($radiobutton=="rb3")
{
header ("location:rb3.php");
}
elseif ($radiobutton=="rb4")
{
header ("location:rb4.php");
}
elseif ($radiobutton=="rb5")
{
header ("location:rb5.php");
}
elseif ($radiobutton=="rb6")
{
header ("location:rb6.php");
}
elseif ($radiobutton=="rb7")
{
header ("location:rb7.php");
}
elseif ($radiobutton=="rb8")
{
header ("location:rb8.php");
}
elseif ($radiobutton=="rb9")
{
header ("location:rb.php");
}
else
{
echo "<br>Please choose at least one radio button";
}
?>

</body>
</html>

 
Old December 1st, 2006, 03:04 AM
Authorized User
 
Join Date: Nov 2006
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to talk2leo
Default

try it like

$radiobutton="$_POST[radiobutton]";

it should work

regards


 
Old December 1st, 2006, 03:06 AM
Authorized User
 
Join Date: Nov 2006
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to talk2leo
Default

and
header("Location: rb1.php");

 
Old December 18th, 2006, 07:01 AM
Registered User
 
Join Date: Dec 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

the problem you are facing is because of the fact that before using header no information (like tags,blank lines) should be send to browser. In the code you provided you are already sending some tags that can be potential root of error

check out this link for more information about header function

http://fr.php.net/header

if it is essential to send some information to the browser before using header function you can use functions of
ob_start() and ob_flush_end(). google on these functions and hope u will find the solution




 
Old December 19th, 2006, 12:29 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

hi,
arslanali is correct try with following code

<?
session_start();
?>
<html>
<body>
<?php
$radiobutton = $_POST['radiobutton'];
if ($radiobutton=="rb1")
{
header ("location:rb1.php");
}
elseif ($radiobutton=="rb2")
{
header ("location:rb2.php");
}
elseif ($radiobutton=="rb3")
{
header ("location:rb3.php");
}
elseif ($radiobutton=="rb4")
{
header ("location:rb4.php");
}
elseif ($radiobutton=="rb5")
{
header ("location:rb5.php");
}
elseif ($radiobutton=="rb6")
{
header ("location:rb6.php");
}
elseif ($radiobutton=="rb7")
{
header ("location:rb7.php");
}
elseif ($radiobutton=="rb8")
{
header ("location:rb8.php");
}
elseif ($radiobutton=="rb9")
{
header ("location:rb.php");
}
else
{
echo "<br>Please choose at least one radio button";
}
?>
</body>
</html>


surendran
(Anything is Possible)
http://ssuren.spaces.msn.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Connect to MSSQL without PHP Library echovue Pro PHP 0 April 2nd, 2007 07:19 PM
php connect to mySql parrot face PHP Databases 3 March 20th, 2007 03:42 AM
Connect php to mysql Nicholsen MySQL 1 December 3rd, 2006 02:34 AM
php connect to mysql p2ptolu Beginning PHP 2 February 24th, 2005 10:43 AM
Using PHP to connect to Oracle cooldude87801 Oracle 2 June 4th, 2004 12:43 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.