Jump to content

$valid == ture and then go to url ???


Jarppi

Recommended Posts

Can anyone help me with this problem.

After the validation is true,  to make it go directly url address.

How can I put php to do that ?

 

Here is the code:

 

<?php

} else {

  include("action.php");

  $img = new action();

  $valid = $img->check($_POST['code']);

 

  if($valid == true) {

    what to put here to go directly to url after true value ;

  } else {

    echo "<center>Wrong code. Type new code, please.

    <p><a href=\"javascript:history.go(-1)\">Try again.</a></center>";

  }

}

Link to comment
Share on other sites

Here the whole code. :-[

 

<?php
  session_start();
?>
<html>
<head>
  <title>MMAF - Modified Motorcycle Association of Finland</title>
</head>

<body>
<CENTER>
<P>
Ole hyvä ja kirjoita kuvavarmenne ennen kuin pääset täyttämään MMAF:n jäsenhakemusta.
<P>
Tämän olemme joutuneet tekemään estääksemme mahdolliset hakkerien hyökkäykset ja "spämbottien" toiminta.
<P>
<?php
if (empty($_POST)) { ?>
<form method="POST">
<img src="securimage_show.php?sid=<?php echo md5(uniqid(time())); ?>"><br />
<input type="text" name="code" /><br />

<input type="submit" value="Lähetä" />
</form>

<?php
} else { 
  include("securimage.php");
  $img = new Securimage();
  $valid = $img->check($_POST['code']);

  if($valid == true) {
    header("Location: http://www.mmaf.fi");
  } else {
    echo "<center>Antamasi kuvavarmenne teksti on väärin. 
    <p><a href=\"javascript:history.go(-1)\">Yritä uudelleen.</a></center>";
  }
}

?>
<A href="http://www.mmaf.fi/">Tästä pääset takaisin MMAF:n etusivulle.</A>
</body>
</html>

Link to comment
Share on other sites

Anything outside the <?php ?> tags is automatically output.  So, if you even have something like this:

 


<?php
// header call here
?>

 

It's still invalid because you have a blank line before the start of the php tag that is sent to the browser as output.

Link to comment
Share on other sites

I just don't get it  ???

What is causing this...

 

This is the error text:

Warning: Cannot modify header information - headers already sent by (output started at /var/www/users/mmaf/www.mmaf.fi/html/kuvavarmenne/varmenne_url.php:17) in /var/www/users/mmaf/www.mmaf.fi/html/kuvavarmenne/varmenne_url.php on line 32

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.