Jump to content

Omzy

Members
  • Posts

    314
  • Joined

  • Last visited

    Never

Everything posted by Omzy

  1. Well basically on one of my contact forms I have: @mail($to,$subject,$message,$headers); I have this because I usually test on my localhost machine, which does not have an smtp function. Without the @ symbol I was getting the error message on screen, so I put the @ symbol in as I thought it was used to check if there is a mail server present. But it's clear now, it's still trying to send the message but just not displaying the error anymore... how can I tell it not to try and send an email if there is no mail server defiined?
  2. Does the '@' symbol just supress the message, or does it perform the same function as the isset()?
  3. Just tested on my friend's live server, same result there also. If you can, try uploading to a live server and test there?
  4. I've got a manual set up on my Windows Vista machine, consisting of Apache 2.2, PHP5 and MySQL 5 Did you definitely try the test by entering an incorrect code? I.e. steps to reproduce: 1) Enter incorrect code 2) Form should re-display, enter the correct code 3) Confirmation message displayed 4) Hit the back button and page has expired I don't suppose it could any setting in the php.ini or httpd.conf file? EDIT: Same result also in Windows XP SP3 / IE7
  5. LOL I actually thought about that just as I got in to bed last night - I wasn't testing using your form! I've tested your form and it does work, however it's not exactly the same as my form. For example my form will re-display the form if there was an error - yours goes to a blank page with an error message printed. I've now amended your form slightly so it does what my form does, and yep I've managed to make it break! Here check the code below and see if you can replicate the problem: <?php session_start(); if(isset($_POST['submit']) && $_SESSION['security_code'] == $_POST['security_code']) { echo 'Thank you. Your message said "'.$_POST['message'].'"'; unset($_SESSION['security_code']); } else { if(isset($_POST['security_code']) && $_SESSION['security_code'] != $_POST['security_code']) { echo 'Sorry, you have provided an invalid security code'; } echo ' <form action="form.php" method="post"> <label for="name">Name: </label><input type="text" name="name" id="name" /><br /> <label for="email">Email: </label><input type="text" name="email" id="email" /><br /> <label for="message">Message: </label><textarea rows="5" cols="30" name="message" id="message"></textarea><br /> <img src="captcha.php?width=100&height=40&characters=5&<?php echo time(); ?>" /><br /> <label for="security_code">Security Code: </label><input id="security_code" name="security_code" type="text" /><br /> <input type="submit" name="submit" value="Submit" /> </form> '; } ?>
  6. I'm using WAMP myself. I'm currently developing on localhost, i haven't got access to a live server yet. Nope, dnt hav any other headers set up anywhere. Anyway i'll give that a go tomorrow, off to bed now. Thanks for your help so far.
  7. LOL I'm using IE8 but I've also tested this on FF3! Trust me second time round I get the page expired message! If it's working for you but not for me, what else could be causing the problem!?
  8. In fact same result in FF - but instead of the "page is expired" page, I get the firefox equivalent message box,
  9. hi thanks for that. it ALMOST worked perfectly, except same problem as i mentioned above: I don't get the page expired message if I enter the correct captcha code and press the back button. If I enter an incorrect code, the page is re-displayed, as it should, i then enter the correct code and i get the confirmation page, click the back button and get the page expired message. i tested this in IE, as 90% of my site visitors use IE...
  10. Something I have discovered - I don't get the page expired message if I enter the correct captcha code and press the back button. If I enter an incorrect code, the page is re-displayed, as it should, i then enter the correct code and i get the confirmation page, click the back button and get the page expired message.
  11. Ok here is file captcha_image.php: <?php session_start(); include("captcha_config.php"); // file with configuration data // create random character code for the captcha image $text = ""; $key_chars = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789'; // 0 1 O I removed to avoid confusion $rand_max = strlen($key_chars) - 1; for ($i = 0; $i < $length; $i++) { $rand_pos = rand(0, $rand_max); $text.= $key_chars{$rand_pos}; } $_SESSION['captcha'] = $text; // save what we create /// code to create the captcha image header ("content-type: image/png"); imagepng ($img); imagedestroy ($img); ?> And I implement it in my quotation form as follows: <?php session_start(); include("header.php") // this is my site's header file $secure = strtoupper(trim(strip_tags($_POST['secure']))); $match = $_SESSION['captcha']; // the code on the image
  12. the page expired is from the server i'm using IE but same result also in FF to be honest i'm not sure this is the best way of going about this, because it is more or less a "hack". there must be a captcha out there that doesn't use sessions, i have searched the net but cannot find anything...
  13. Doesn't work. I put that code above the session_start() and above the main header output. I also put a session_destroy() on the confirmation page.
  14. Yep, that's fine. Where should I place that code?
  15. No, instead of page has expired, I want it to take the user back to the original page where they submitted the form!
  16. Hi, Well basically I've got a captcha implemented on my "quotation form", but like most captcha scripts it uses sessions. Now when the user has submitted the form with the correct captcha code, a confirmation page is displayed. If the user then clicks the back button, they get a "page has expired" error page. Ideally I don't want to be using any hacks to get around this, so any simple solution to this would be most welcome.
  17. Ideally just one word authentication and pretty simple, but effective. Preferebly one that does not use Sessions because then the user is unable to press the back button to go back to the original page after submitting the form... I know I could just put a text link there but not all users would click that link...
  18. I managed to figure it out (no thanks to "genericnumber1")... foreach($attributes as $key1 => $value1) { echo '<select name="'.$key1.'">'; foreach($value1 as $key2 => $value2) { echo '<option value="'.$key2.'">'.$value2.'</option>'; } echo '</select>'; }
  19. I'm creating a form and want some drop down boxes generated from an array: I want to do something like this: $attributes=array( 'location'=>array('manchester'=>'Manchester', 'london'=>'London'), ); Essentially what I want the code to do is output the following: <select name="location"> <option value="manchester">Manchester</option> <option value="london">London</option> </select> I've got the code to match on the outer array but I now need a foreach loop which will output the values from the inner array. I want to do this using one main array ($attributes) only.
  20. I have 3 questions to ask: 1) Let's say I'm in the admin area - and I have an "upload image" button on a car details page. How do I link the image file with it's corresponding car entry in the database? 2) Let's say I have 10 fields in the database to store filenames for 10 images - some cars might not have 10 images so won't it error if it tries to fetch 10 images for each car? 3) Do the filenames for the thumbnail images need to be entered in the database?
  21. neil - i need thumbnail images to appear on the car details page, then each thumbnail opens up it's full image...
  22. This would have been PERFECT if I could get it to work on PHP5! http://real-estate-management-software.org/tutorial1/quickstart1.htm I'm devasted! Anybody want to give it a go and see if they can get it working on PHP5?
  23. cleary1981 - thanks for that suggestion. I had a look at it but again it's more of a shopping cart tool... neil - that's true about the login system. so the main issue is the images i suppose. i would need to create a system that allows me to add/remove images for a car - how would I go about linking the images to it's correspending car? There can be any number of images.
  24. I can easily code a form for the basic product management - but the tricky bit would be implementing a good login system and image uploader with auto-thumbnailing...
×
×
  • 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.