Jump to content

psymonic

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

psymonic's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey I have fixed the problem, you were right corbin it was not a .htaccess error. Im totally gutted i wasted so much time on a stupid mistake, I really need to learn to take regular breaks. A fresh mind today and I found the problem in under 5 minutes. The problem, on my old sites I always used capital letters on the captcha image and then convert whatever the user enter into upper case, but I decided this time to use a function i created to generate a random string, upper, lower and nums. I totally forgot about this and the font I am using looks the same in upper and lower case. So it all works now when I convert the captcha text and the user entered data to upper case. If there is one thing I've learned from this its to have a break if you can't fix something with an hour or so, I just find it so hard to leave something which isn't working. Well thanks for your time and advise corbin it is very much appreciated. Your a top guy. Best Regards Simon
  2. Hmmm, As far as I am aware it should not matter if the session is set in an included file or one called thought the image source. I have used captcha scripts in the exact same way many times in the past but have never encountered this problem so surely it can't be a problem that the session is being set in a seperate request.
  3. Thanks for your reply corbin, Do you not think this is a mod rewrite issue? Ive worked on with PHP for 3-4 years now and have been used this same method to create captcha images for atleast 2 years and without mod rewrites it works perfectly every time. From my experience i have noticed that if you create a session on line 1 you should be able to access it in line 2 unlike cookies which cannot be accessed until the next page load. I think I understand what your saying, but im sure with PHP if you call another script into the script your using, it will make the request then and there, it has to otherwise you wouldn't be able to access variables etc with have been set in a header for example. I still feel strongly that this is a mod rewrite problem. If you or anyone else has any more ideas for a possible fix then Ill be extremely happy to hear them. Thank You Simon
  4. Hello all, Im going to post my .htaccess file here first so i can refer to it: <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?page=$1 [L,QSA] </IfModule> A friend made this for me so im not really sure how it works or if this will be a simple fix. The idea was for users to be able to go to say domain.com/register and this will send a request to domain.com/index.php?page=register. Ok that all work fine. This thread title isn't 100% clear, i can safely include files without calling multiple headers. But my problem is, that i have created a script which creates a captcha image. Say the script is called image.php. Inside the image.php script I created a session called $_SESSION['image']. Now to load the captcha image i use the line <img src="image" alt="captcha" /> There is no .php becuase its not required due to the .htaccess. So that loads the image successfully bujt when i put directly after that line <?php echo $_SESSION['image']; ?> The session has no value. The crazy thing is if reload the pagethe session does exists. But instead of display a new session value (because a new captcha image has been created for that page), it displays the previous page session value. Its almost as if, the session is not actually set until the end of the script is reached. which is very strange because my other sessions do not do this that are inside the script or that are created in included files. I have also tried 1 more test, that would back up the idea of the script not running untill the end, which is: in image.php i wrote content to a file and then on the main page used echo to display the content of the file and it did not display anything, however i checked the content of the file manually and it was there. I would say im 99.9% sure this is due to the .htaccess file. Ive created many captcha system in the past but only one with this mod rewrite and its the only one i havent got working. Sorry for my long post I was trying to be as specific as possible. If anyone know what may be causing this problem and can help me out then I will extremely greatful. If you need any more information then please ask and I will reply ASAP. Thank You Simon
  5. by posted do u mean a form submitted and i though no-cache made it look for a new version of a page. whats the point in looking for a new version if the page already has been loaded. This is really confusing. But thanks for your reply.
  6. Its not code its a HTTP Resonce from servers, take this very thread for example i got this responce HTTP/1.x 200 OK Date: Mon, 10 Nov 2008 16:42:35 GMT Server: Apache/2.2.8 (EL) Expires: Mon, 26 Jul 1997 05:00:00 GMT Cache-Control: private Pragma: no-cache Last-Modified: Mon, 10 Nov 2008 16:42:35 GMT Content-Encoding: gzip Vary: Accept-Encoding Keep-Alive: timeout=2, max=100 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html; charset=ISO-8859-1 im asking what the "private" means in: Cache-Control: private and what would happen if you replace private with public to give: Cache-Control: public also I still need to know what: Cache-Control: post-check: 1, pre-check:1 would do. Thanks
  7. It seems no one has, however i have a zend study guide and its used it there however it just says its use for caching, but it doesnt say what. Here in a IE blog they are talking about it. http://blogs.msdn.com/ie/archive/2006/06/01/613132.aspx Also can someone please tell me what setting public and private do in cache-control headers. Thanks
  8. I think doing something as simple as not sessing a action attribute will do what you want, hopefully I wouldn't say thats teh ideal way to solve your problem. I would do something like this. <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> Regards
  9. yes you missed the essential curly brackets Crayon Violent has said and yes you can nest as many if..else statements as you like inside and outside of functions and classes.
  10. Thanks for replying thorpe, most sites dont use post-check or pre-check. Here is a site which mentions them but doesn't use them. http://www.computec.ch/projekte/httprecon/?s=database&t=head_existing&f=cache-control I think when post-check is set to 0 when you submit a form and then click back you are asked if you want to resubmit the form but when its set to 1 and you submit a form and click back, you go back to the previous page without the form being re submitted. regards I was either post-check or pre-check which does that but i think it was post-check, either way i cant remember at all what the other one does.
  11. Hi all im new to this board, hopefully you will be able to help me out here. My question is what exactly does post-check and pre-check do, I used to know this but i forgot and was stupid enough to not comment my code. If anyone has a definite answer ill be thrilled to hear it because endless searchs on google just couldnt help me out this time. Thanks Guys Simon
  12. firefox 2+ definitely and then probably opera, id not tried it untill not long ago, but it kicks IE's ass
  13. simply do this http://www.phpfreaks.com/forums/index.php/topic,162502.0.html on linux
  14. i saw someone saying how to do this on a windows server, i never knew this was possible, im using linux and want to do the same thing as i get a cpu error at least once a week, not a big deal but id rather it not be there. Can someone help, if possible please avoid OOP as i suck at it. Regards Simon
×
×
  • 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.