Board index   FAQ   Search  
Register  Login
Board index PHP PHP Scripts

Getting php to exit, run another php or continue

Links for php scripts

Moderators: macek, egami, gesf

Getting php to exit, run another php or continue

Postby chrisp » Wed Feb 05, 2003 4:49 am

Hi, I'm new to php, so this might'nt be possible .... I'm trying to get php to evaluate the result of [Yes] [No] radio buttons in html and then run php scripts. I don't know what the php coding should be, once either of the radio buttons is selected. I was hoping that by selecting [Yes] then php script continues, but selecting [No] would stop the current script, exit and run another php.
I have included what I am trying to do below ....

<form>
<tr>
<td colspan=4>Are you over 21?
<input type="Radio" name="over21" value="1">Yes <input type="Radio" name="over21" value="0">No
<?
if No or value="0" then display another.php and exit this.php otherwise continue with this.php
?>
</td>
</tr>

Any help would be great ..... Thanks. :D
chrisp
New php-forum User
New php-forum User
 
Posts: 2
Joined: Wed Feb 05, 2003 4:24 am
Location: Australia

Postby Redcircle » Wed Feb 05, 2003 4:25 pm

Code: Select all
<form>
<tr>
<td colspan=4>Are you over 21?
<input type="Radio" name="over21" value="1">Yes <input type="Radio" name="over21" value="0">No

<?php
if(!$over21)
include("another.php");
else
if($over21)
include("this.php");
 
?>
</td>
</tr>
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Thanks

Postby chrisp » Mon Feb 10, 2003 4:43 pm

Thanks Redcircle - that's excellent. :D
chrisp
New php-forum User
New php-forum User
 
Posts: 2
Joined: Wed Feb 05, 2003 4:24 am
Location: Australia


Return to PHP Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

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

cron