Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Redirect or error if the code doesn't exist in code.txt

$
0
0

I have in promotie.php the next form:

<form accept-charset="UTF-8" action="redirect.php">
  <input name="code" type="text" id="code" maxlength="15" />
  <input type="submit" value="Submit"/>
</form>

In redirect.php I have this code:

<?php
header('Location: download.php?code='.$_POST['code']);
?>
What I want to do is the next thing: I will create a file code.txt, where I write on each line my promotional codes.

 

Now how can I redirect to promotieerror.php or show a error if the code that was writed by the user doesn't exist in code.txt ?

P.S.: I don't want to use MySQL/Databases.

Thanks in advance for help.


Viewing all articles
Browse latest Browse all 13200

Trending Articles