
- You are not logged in. | Login
March 1, 2007 10:54 am
- sirburpsalot
- Member


Protection from autoregistration
Hallo! I have a problem. I need to install protection from autoregistration into script (i.e. I need numbers on images to put in). How can I do it?
March 1, 2007 11:01 am
- bandlist12
- Member


Re: Protection from autoregistration
You are to throw these very numbers in the session and put them out with an image. If POST and session’s contents coincide you are to let them through.
March 1, 2007 12:37 pm
- napkdd1
- Member


Re: Protection from autoregistration
Help me to grasp such a thing.
Into the registration form I’ve inserted such a tag
<IMG SRC=”Imige.php”>
I generate a new image with script.
This script creates a new image and records variable into session. I know that it records the right number and generates right image but image that is put out into browser is not that generated with my script but the former one. I think caching has something to do with it but I don’t know how to fix it. I’ve already inserted following strings before the image output
File image.php
<?
/*code of image generation
* ….
*/
Header("Cache-Control: no-cache,no-store,must-revalidate");
Header("Cache-Control: post-check=0,pre-check=0,false");
Header("Pragma: no-cache");
Header("Content-type: image/png");
imagePng($Image);
imagedestroy($Image);
?>But it doesn’t help.
The old image is put out.
And one more question concerning session.
I’ve read that a session should be made special for an image.
I’ve got authorization and by starting script session is already created which exists till the browser is closed.
How to organize a special session for an image properly?
March 1, 2007 12:39 pm
- Stre@m
- Member


Re: Protection from autoregistration
But it doesn’t help.
The old image is put out.
Add to image.php a parameter with random number.
I’ve read that a session should be made special for an image.
Read nothing like this any more.
March 1, 2007 12:43 pm
- mellis
- Member


Re: Protection from autoregistration
<IMG SRC=”Imige.php?secret_code=<?echo time()?>”>
P.S. secret_code is for no one to guess 
March 1, 2007 12:46 pm
- Mr.SMart
- Member


Re: Protection from autoregistration
As I understood this advice enables to evade caching of images.
March 1, 2007 12:48 pm
- napkdd1
- Member


Re: Protection from autoregistration
I have a random parameter… I know that it may be cached but this error is not stable.
Sometimes an image is old and sometimes it is normal.
And if someone has already worked with PHPEd… I’m fed up with striving with the fact that until it puts out the form and I put in (in the checkout mode) data into the form it restarts script 2 or 3 times and image will be regenerated again. More precisely, it won’t be an image but a code’s string but an old image will be displayed on some reason…
March 1, 2007 12:51 pm
- steven9x
- Member


Re: Protection from autoregistration
I have a question concerning saving unique captcha pictures.
By generating random codes it’s better to save captcha pictures with unique name as far as in such a case we evade problems with caching (names are unique).
But the question is following: where these pictures should be saved?
I’ll explain: as far as new authorization codes are generated with time they create new files on the disk (pictures with unique names). The task is to delete them. If we save them in tmp-folder they will be deleted time after time by server itself but in this case web-server won’t gain any access to them. Or am I mistaken here?
If we save pictures in the folder which is available to the web-server this folder won’t be cleansed by anyone as far as it is not a tmp-folder. In this case all the files should be deleted by means of PHP-script.
Share your experience how to do it better, please.
Thanks.
March 1, 2007 12:56 pm
- Keeper
- Member


Re: Protection from autoregistration
steven9x, what for do you save pictures if they are disposable?
March 1, 2007 1:00 pm
- steven9x
- Member


Re: Protection from autoregistration
I understood. I’ve been trying to do it through headings but I haven’t managed it. I’ll keep trying and ask you if I have any questions 


