Jump to content

I need a small php script


dthievin

Recommended Posts

I don't know anything about php, and I probably shouldn't be here.

 

I need to write a small php script that will compel visitors to enter a specific word, for example, "cat".  If they enter the correct word, then they are granted access to the next page.

 

I realize that this is really the same as any image-recognition script such as those used right here on php freaks.  The only difference is that I don't need to portray a graphic, nor will my script have any other registration purpose.  Really basic.

 

I sure appreciate whatever help someone offers.

Link to comment
https://forums.phpfreaks.com/topic/46773-i-need-a-small-php-script/
Share on other sites

designknights.. why using $_GET[]? thought he was going to use a form.. in that case use this

 

make a file called index.php or whatever you want.. (in this example it's index.php)

<?php
if (isset($_POST['secretword'])) {
if ($_POST['secretword'] == "CAT") {
Header("Location: http://www.url-to-next-page.com/nextfile.php");
}
else { echo "You did not type the correct word"; }
}
?>
<html>
<body>
<form name="thesecret" method="post" action="index.php">
Enter the secret word: <input name="secretword" type="text" />
<br /><input type="submit" value="Submit" />
</form>

 

think that should fit your request?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.