Sign in to follow this  
onceloving

PHP HELP

Recommended Posts

onceloving    106
I can't seem to figure out why these functions don't work like they should work. Can someone help me?
<html>
<?php
echo $mark;
session_start();
if ($_POST["action"] == "Previous 20")
{
$mark = $mark - 20;
}
if ($_POST["action"] == "Next 20")
{
$mark = $mark + 20;
}
if ($_POST["action"])
{
?>
<script>window.location="<?php echo $PHP_SELF?>?mark=<?php echo $mark?>"</script>
<?
}
?>
<body>
<form method="post" action="<?php echo $PHP_SELF?>">
<input type=submit name="action" value="Next 20">
<input type=submit name="action" value="Previous 20">
</form></body></html>

Share this post


Link to post
Share on other sites
Deranged    668
There is a webdev forum you know.

Also, a lot of the time, php doesnt like spaces in $_POST's, what exactly are you trying to do, te code is fine, but I think if we knew what you were trying to do, we could tell you a better way of going about things(also some browsers dont like script tags without you speicifying what type of script it is).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this