473,466 Members | 1,436 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to store the value ?

150 New Member
i need to make Registration code to prevent from automated registrations in my site but im having problem with this code :
[PHP]<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<?php
$codeID=addslashes($_POST['Code']);

$number=rand(1,3);

if($codeID==""){
echo "Please enter the code shown";
}else{
if($codeID==$CodeKEY){
echo "Right";
}else{
echo "Please enter the code shown";
}
}

switch($number){
case 1:
$CodeKEY="a2je9";
break;
case 2:
$CodeKEY="b1hk5";
break;
case 3:
$CodeKEY="c2589";
break;
}
?>
<?php
echo "<br /><img src='IMGS/Code_$number.gif' border='1'/>";
?>
<br />
<form id="form1" name="form1" method="post" action="">
<input name="Code" type="text" id="Code" maxlength="5" />
<input name="register" type="submit" class="btn" id="register" value="Signup"/>
</form>
<?php echo "Image Key :".$CodeKEY."<br />"."Input Code:".$codeID; ?>
</body>
</html>[/PHP]

any one will test this code need this images:



Jul 28 '07 #1
4 1182
pbmods
5,821 Recognized Expert Expert
Heya, smartic.

What do you want your code to do? Give an example.
What is your code doing that you don't want it to do? Give an example.
What is your code *not* doing that it is supposed to? Give an example.
Jul 28 '07 #2
smartic
150 New Member
What do you want your code to do?

like yahoo registration



What is your code doing that you don't want it to do?

my posted data dosn't match with the image.

What is your code *not* doing that it is supposed to?

Check between what i have posted and the image.
Jul 28 '07 #3
kovik
1,044 Recognized Expert Top Contributor
You need to rethink what you are doing. What you are attempting to create is a CAPTCHA, and you are doing it in a very unorthodox and insecure manner. Any bot could simply remember the filename of the CAPTCHA image and re-enter it whenever it faces that image again.

You should at least look into some tutorials and familiarize yourself with image manipulation and PHP's GD library.
Jul 28 '07 #4
pbmods
5,821 Recognized Expert Expert
If you want to build your own CAPTCHA, that's great. I wish you the best of luck; I know absolutely nothing about it that would make my opinion useful.

If you just want to get it working, though, you can also use re-CAPTCHA, which is free.
Jul 28 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: sector119 | last post by:
Hi I use optparse with callback action, my callback function return some value, but optparse does not store this value, options.callback_dest always is None. How can I store callback function...
2
by: forums_mp | last post by:
I've got an STL class (see below) with two functions to store and retrieve data - msg structs. The "Store" function when called will copy the received message (depending on which message) into...
3
by: Tony Johansson | last post by:
Hello! Assume you want to store field object that a chess board consist of. A chess board consist of 64 fields where each field is either white or black. Now to my question how should I...
12
by: turtle | last post by:
I have been reading a few topics on storing data in a table and how it is usually a bad idea. Can someone give me a clue on how to do the following: I am tracking Earned Value for my programs. ...
0
by: Harley | last post by:
I am trying to write a personal app to keep a bank balance and history. The problem I'm haveing is finding a decent way to store the data on a pocketpc under .net compact framewok useing vb.net....
3
by: Solution Seeker | last post by:
I want to Store the String value with Single Quotes in the Field of Database where if i try to Store the String value with Single Quotes (as it is) then it is throwing the error as SQL String...
2
by: bonnie.tangyn | last post by:
Hello all Would it be possible to store javascript document.forms.value to ASP session as global variable? If it is not possible, how can I pass the javascript document.forms.value to...
10
by: Brett Romero | last post by:
I'd like to store something such as the following the my app.config file: <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="DEBUG" value="true"/> <add...
6
by: c676228 | last post by:
Hi everyone, I wrote a store procedure that fetch one row data in the database based on the parameter value I entered. After I created the store procedure, the store procedure code looks like...
2
by: hikmaz | last post by:
I am trying to get the rightmost digits (%10) of a number (taken from the user) and store it into successive array locations and get rid of the rightmost digit (\10) to store the next and so on and...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.