PHP captcha

0
August 16, 2011

Dear Experts,

I have web form which I send the input as an email..

I have a captcha form and session works inside..

but if anybody submits the form with wrong correction key or if anybody use back button, all the information they entered vanishes..disapper..

I think I can hold them if I write inside the textbox for example in ASP<%=myvariable%>

how can write it like this in PHP?

is it like this <?=$variable?>

I use this captcha

http://www.codewalkers.com /c/a/Misce llaneous/C reating-a- CAPTCHA-wi th-PHP/

Comments See all(0)

Add comment
0
August 16, 2011

$_SESSION['key'] = $ResultStr;

than you can add more as below

$_SESSION['key']['ResultSt

r'] = $somevar; // you can assign as multidimensional array

or

$_SESSION['somevar'] = $somevar;

and than access the session variable like this in textbox

echo '<input type="text" name="captchatext" value="<? echo $_SESSION['somevar'];?>">';

or

echo '<input type="text" name="captchatext" value="<?=$_SESSION['someva

r'];?>">';

0
August 16, 2011

echo '<input type="text" name="captchatext" value="<? echo $somevar;?>">';

echo '<input type="text" name="captchatext" value="<?=$somevar;?>">';

0
August 16, 2011

Dear Kalmax,

it didn't work I think because of this,

the sesssion only keeps the $key,

how can I add more variable to the session ?

$_SESSION['key'] = $ResultStr;// carry the data through session

thank you

0
August 16, 2011

thank you

Related Questions

PHP captcha code

Dear Experts, &#160; &#160; &#160; &#160; &#160; &lt;?php if (isset($_GET[&quot;hdwmsg&quot;]) &amp;&amp; $_GET[&quot;hdwmsg&quot;] == &quot;invalid&quot;) echo chr(60).&quot;font color=red&quot;.chr( Read More

Views

21

Votes

0

Answers

2

August 16, 2011

How can I add my captcha code to this php page?

Hi there, I have a php page and I would like to add a standard captcha code in it. The captcha code is here: &lt;td colspan=&quot;8&quot;&gt;&lt;img alt=&quot;CAPTCHA Image&quot; src=&quot;/securimage Read More

Views

13

Votes

0

Answers

11

August 15, 2011

Change text color when invalid CAPTCHA

Hello guys, I have just implemented a CAPTCHA routine (with help from the experts here) and want to manage the invalid CAPTCH by changing the text color of the following: &quot;Please enter the code a Read More

Views

38

Votes

0

Answers

16

August 15, 2011

How to send mail when Captcha is valid.

Experts, I am fairly new at web design and am trying to install captcha on my form. I have been following the example shown on this link: http://www.encaps.net/soft ware/php-c ap Read More

Views

8

Votes

0

Answers

63

August 15, 2011

Session variable empty in PHP on IIS7

Good Day I have a bit of a problem as to where my sessions variable is empty. If you have a look at the code below and when it is executed the captcha returns the image, so I know the php is working. Read More

Views

16

Votes

0

Answers

5

August 16, 2011

captcha script works but does not stop the form from submitting

Hi, i am adding captcha to the my webform using http://www.phpcaptcha.org/ The captcha image displays and the script successfully validates it. When the user input does not match the captcha image the Read More

Views

9

Votes

0

Answers

4

August 16, 2011

PHP Email Headers (From)

Hi Experts, I have a form on my site with basic CAPTCHA security on it. Everything is working great. I&#39;m having trouble setting my &quot;From&quot; headers. I want the email to come from the users Read More

Views

8

Votes

0

Answers

5

August 16, 2011

Editing a Php contact form template

Script I am editing is listed below.... &#160;the problem is found &#160; &#160; $embody = &#39;$name[2], $embody[2], $email[2], $number, $located, $subject, $why, $otherparty&#39;; &lt;?php session_s Read More

Views

124

Votes

0

Answers

4

August 16, 2011

passing $_POST variables to another page after $_SERVER['PHP_SELF']

I have a form that has an image captcha. In order to have the test for the captcha I have a form action = &quot;$_SERVER[&#39;PHP_SELF&#39;]&quot;. And the script for the captcha gets run. Now if that Read More

Views

10

Votes

0

Answers

9

August 15, 2011

Refresh Captcha

I am using code given in this link to create captcha images. http://www.dreamincode.net /forums/sh owtopic542 75.htm The code is working fine, but I have a hyperlink o Read More

Views

3

Votes

0

Answers

4

August 16, 2011

Problem with PHP Script Inserting Image name into database

Hi Experts, I have &#160;form that is mostly working. You can see it in action here: http://www.enviromedia.com /careers/x m-recruiti ng/ If I complete the form but DO Read More

Views

80

Votes

0

Answers

17

August 16, 2011

Stopping direct access to php files

Hi all, I have my own php site with a messageboard, but I&#39;m having a spam problem lately. I have a captcha which does string verification, but it seems that they are circumventing it by calling th Read More

Views

4

Votes

0

Answers

16

August 16, 2011

PHP MySQL Record will not Update

Hello Experts, I have a PHP SCript that worked before but suddenly quits. &#160;It returns a Blank age and takes forever to process, It says it is waiting on the local host. &#160;Can someone tell me Read More

Views

30

Votes

0

Answers

4

August 15, 2011

Having Issues with PHP cURL Script - Please Help!

I am having issues with a cURL script. &#160;It doesn&#39;t seem to want to grab the information I am telling it to and just gives a blank white page. I have included the script below. &#160;Please He Read More

Views

8

Votes

0

Answers

1

August 16, 2011

PHP and mySQL forms maker?

Hello, I have to make 10 small web sites over the next 30 days and was looking for a tool that would help me make forms to be entered in EACH web sites mySQL database? &#160;I have seen form makers bu Read More

Views

14

Votes

0

Answers

1

August 16, 2011

Best Practice for Inserting from PHP Form into Database

I need to know the best practices for writing a form processing script. I really want to code this myself &#39;caus there is so much extra stuff in Dreamweaver (Granted I use it to do my html) but whe Read More

Views

4

Votes

0

Answers

13

August 15, 2011

Help with php form processor

I have the code below as my form processor, My webform is basic, and contains: Name, email address, subject, colony, comment and a captcha along with the send button. I have the form working but I dec Read More

Views

5

Votes

0

Answers

6

August 16, 2011

PHP database and time diffrence question

Dear Experts, $query = &quot;SELECT Email,Date FROM Mytable where Email=&#39;$visitormail&#39;&quot;; $sql=mysql_query($query); $result = mysql_fetch_array($sql); $date_comingfrom_database = $result[& Read More

Views

27

Votes

0

Answers

6

August 16, 2011

PHP time diffrence and if statement

Dear Experts, I need to check the time diffrence, I do not want my user to submit the form over and over again. I already use Captcha by the way and I&#39;m new to PHP. $query = &quot;SELECT Email,Dat Read More

Views

6

Votes

0

Answers

9

August 16, 2011

online form not working

We are using http://www.tectite.com/ for an online form on the below website: http://myrascakes.com/orde r.html We keep getting an error and don&#39;t know how to fix it. &#160;There is a r Read More

Views

728

Votes

0

Answers

15

August 15, 2011