Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP 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:06 AM
Authorized User
 
Join Date: Nov 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default cannot proceed 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 19th, 2006, 01:20 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
try this
<?
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
 
Old December 21st, 2006, 05:49 AM
Authorized User
 
Join Date: Dec 2006
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to paagle
Default

why not use switch case block?
I think its simpler and saves somelines of code

---
Paagle
TEAM LEADER-Team Xuberance(http://www.xuberance.com)
 
Old December 26th, 2006, 11:26 AM
Registered User
 
Join Date: Dec 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ïîïåðùå âè äàëáàéîáè, ³ õóéíþ ïèøèòå!
Õåäåðè ïîâèíí³ â³äïðàâëÿòèñü äî âèâîäó ³íôè íà åêðàí .. ò³ïà
<?
session_start();

$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";
}
?>
<html>
<body>


</body>
</html>


À äðóãå áëÿòü, ÿêîãî õóÿ ñò³êè êîäó ïèñàòè, ÿêùî ìîíà îñü òàê,
<?
session_start();

$radiobutton = $_POST['radiobutton'];
header ("location:".$radiobutton.".php");
?>
<html>
<body>


</body>
</html>

òóò º ïàðó áàã³â, àëå äóìàéòå ñàì³! )))

 
Old December 26th, 2006, 11:33 AM
Registered User
 
Join Date: Dec 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ïàëþáå!!
íàäà èñ÷î ïðàâåðÿäü çíà÷åíèéå êàòîðàéå ïèðèäàéîööà, ïàòàìóøòà éåñëè ãýòàâà íèäåëàöü òàäà êàêîéòà ÌèçäýðÈãç ìîæûò âìåñòà íóæíàâà ôàéëà àêòðûòü ôàéë êàòîðûé ñàôôñåì íèíóæûí... òà÷íåè èìó íóæûí à âàì, îìåðèêàí÷åãè ïåñäà!!

 
Old December 26th, 2006, 11:40 PM
Authorized User
 
Join Date: Dec 2006
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to paagle
Default

wat language is that?

---
Paagle
TEAM LEADER-Team Xuberance(http://www.xuberance.com)
 
Old December 27th, 2006, 03:27 AM
Registered User
 
Join Date: Dec 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by paagle
  wat language is that?

---
Paagle
TEAM LEADER-Team Xuberance(http://www.xuberance.com)
äîÿðêî, ãýòà îëáàíöêèé

 
Old December 27th, 2006, 03:37 AM
Authorized User
 
Join Date: Dec 2006
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

try switch case
thanx
Raaj

 
Old December 27th, 2006, 03:58 AM
Authorized User
 
Join Date: Dec 2006
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

try this:

<?
session_start();
?>
<?
if(isset($_POST['submit']))
{
$radiobutton = $_POST['radiobutton'];
if ($radiobutton=="rb1")
{
    header ("location:mail_text.php");
    exit;
}
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";
}
}
?>
<html>
<body>
<form name='a' method='post' action='radio.php'>
<input type='radio' name='radiobutton' value='rb1'>rb1<br>
<input type='radio' name='radiobutton' value='rb2'>rb2<br>
<input type='radio' name='radiobutton' value='rb3'>rb3<br>
<input type='radio' name='radiobutton' value='rb4'>rb4<br>
<input type='radio' name='radiobutton' value='rb5'>rb5<br>
<input type='radio' name='radiobutton' value='rb6'>rb6<br>
<input type='radio' name='radiobutton' value='rb7'>rb7<br>
<input type='radio' name='radiobutton' value='rb8'>rb8<br>
<input type='radio' name='radiobutton' value='rb9'>rb9<br>
<input type='submit' name='submit' value='Submit'>
</form>
</body>
</html>


Raaj






Similar Threads
Thread Thread Starter Forum Replies Last Post
how to connect to next php page... knightneo PHP How-To 4 December 19th, 2006 12:29 AM
How shall i proceed vinu123 ASP.NET 2.0 Basics 5 December 14th, 2006 01:02 PM
How to encrypt a PHP page nomad PHP How-To 4 June 26th, 2006 11:41 AM
passing value from Php to PHP page baby PHP How-To 3 March 31st, 2005 02:13 AM
PHP and Page Redirection joanncae BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 May 21st, 2004 11:07 AM





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