Jump to content

doni49

Members
  • Posts

    515
  • Joined

  • Last visited

Everything posted by doni49

  1. <input type="checkbox" name="cbox[bx1]"> <input type="checkbox" name="cbox[bx2]"> <input type="checkbox" name="cbox[bx3]"> <input type="checkbox" name="cbox[bx4]"> <input type="checkbox" name="cbox[bx5]"> <input type="checkbox" name="cbox[bx6]"> $_POST['cbox'] will be an array listing each checkbox that was selected. If a box isn't selected, it won't be part of the array.
  2. I just went back and took another look--if you are wanting to have this image UNDER the text, could make it the background image and then put the text on top of that.
  3. There's an error in your CSS code. It's not a PHP problem.
  4. File not found.
  5. ftell takes ONE argument--the file pointer.
  6. Well you should start with getting the query to work--or make sure that it IS working.
  7. Here's what I do: $homeDir = "/home/username/"; $domain = "mydomain.com"; include($homeDir . "includes/comm_config.inc"); $ct = file_get_contents($homeDir . "includes/template.html"); $css = file_get_contents($homeDir . "public_html/css/styles.css"); $ct = str_replace("%css_file%", "<style>" . $css . "</style>", $ct); $header = substr($ct, 0, stripos($ct,"%main_area%")); $footer = substr($ct, stripos($ct,"%main_area%")+11); echo $header; echo "This is my content."; echo $footer; Then in my template file, I have %css% in the header area, and %main_area% in--you guessed it--the main content area.
  8. NP--out of curiosity. What was it?
  9. My guess is that the following line is evaluating to TRUE. if(isset($_COOKIE['ID_my_site'])) But the the query doesn't return anything. In such a case, the header command at the end of the end of the script will not run because the if was true. Then the other two header statements would not run either because because the while loop would fail.
  10. Yes--that error message is exactly what you get if you use the header cmd and have already sent anything to the browswer.
  11. Don't forget that the header command has to be sent before anything at all is sent to the browser.
  12. Just to be sure it's actually including/finding THIS file, put something at the top of the file--doesn't even need to be PHP code if you put it before the "<?PHP" tag. Something as simple and obvious as your name. If you don't see that, then assume there's an issue with finding the right file. A problem with brackets should be throwing errors unless you've gor error reporting turned off--if it's off, turn it back on.
  13. Here's what I use--I found in a Larry Ulman book. $_SESSION = array(); session_destroy(): setcookie('PHPSESSID', '', time()-3600, '/', '', 0,0);
  14. You could load apache and let apache listen to the port. Make your script the default web page.
  15. What do you mean it doesn't show? NOTHING shows up? Just a blank screen? Can you give us a link to the page?
  16. NP Glad to see you got it working. Have fun!
  17. $myArray["google.com"][0] = 0; $myArray["google.com"][1]=29.95; $myArray["mygoogle.com"][0] = 1; $myArray["mygoogle.com"][1]=39.95; echo $myArray["google.com"][0]; //will return 0 echo $myArray["google.com"][1]; //will return 29.95 echo $myArray["mygoogle.com"][0]; //will return 1 echo $myArray["mygoogle.com"][1]; //will return 39.95
  18. As to the headers already sent error, I don't see where you're sending headers. Take a look at reply #10 above. I have no idea what effect this issue would have--but I know it won't work right. It might be causing strange issues.
  19. That code has the same effect and is not what I was suggesting. This is more along the lines of what I was suggesting. And don't forget this does nothing to validate the code. $autoreply = "Thank you for for your referral."; $validForm = TRUE; if($from=='') {print "You have not entered an email, please go back and try again"; $validForm = false;} if($Name=='') {print "You have not entered a name, please go back and try again";$validForm = false;} if($Phone=='') {print "You have not entered a phone number, please go back and try again"; $validForm = false;} if($Company=='') {print "You have not entered a company name, please go back and try again"; $validForm = false;} if($Name1=='') {print "You have not entered a company name, please go back and try again"; $validForm = false;} if($Phone1=='') {print "You have not entered a company name, please go back and try again"; $validForm = false;} if($Email1=='') {print "You have not entered a company name, please go back and try again"; $validForm = false;} if($Company1=='') {print "You have not entered a company name, please go back and try again"; $validForm = false;} if ($validForm){ $send = mail($to, $subject, $body, $headers); $send2 = mail($from, $subject2, $autoreply, $headers2); if($send) { header("Location: http://www.xicg.com.au/referral/thankyou.html"); } else { echo "We encountered an error sending your mail, please notify [email protected]"; } } } What we're doing is assuming that every thing is ok and then the first time a problem is found, we change the test var to reflect that.
  20. ok. I looked through the entire thing and that's all I see as far as bracket issues. But as written (I'm looking at the original code), if the name field is not empty--even if every other field IS EMPTY--the mail function will attempt to run. Due yourself a favor--before all of your if statements, set a boolean to true. Then the first time a field doesn't validate correctly set that variable to false. Put the mail functions in a separate if statement--if the boolean is TRUE send the messages. If the boolean is false, DON'T send the messages.
  21. I haven't looked it all over yet--but in the beginning, you are trying to set array values with curly braces instead of brackets. $fields = array(); $fields{"Name"} = "Name"; $fields{"Company"} = "Company"; $fields{"Email"} = "Email"; $fields{"Phone"} = "Phone"; $fields{"Name1"} = "Referral Name"; $fields{"Company1"} = "Referral Company"; $fields{"Email1"} = "Referral Email"; $fields{"Phone1"} = "Referral Phone"; $fields{"Message"} = "Additional Comments"; should be $fields = array(); $fields["Name"] = "Name"; $fields["Company"] = "Company"; $fields["Email"] = "Email"; $fields["Phone"] = "Phone"; $fields["Name1"] = "Referral Name"; $fields["Company1"] = "Referral Company"; $fields["Email1"] = "Referral Email"; $fields["Phone1"] = "Referral Phone"; $fields["Message"] = "Additional Comments";
  22. I was going to point out the issue about the brackets. But besides that....... You should really validate what the user enters before sending the message. If I were to visit your form, I could type the following in the "From field". "[email protected]\r\nBCC:[email protected],[email protected]" If I did that I would be using your server to send spam. Now it's not like someone would actully sit there and type that in. But it would be really simple to write a script that would access your form and fill in that data.
  23. The script would have to upload the file(s) to your server and then attach it/them. Do a search on "File Upload". Once you have that, you need a way to attach the file to the message. The simplest way to handle email attachments and a WHOLE BUNCH more is to use PHPMailer (http://phpmailer.codeworxtech.com/) which is a free PHP Class.
  24. There should be something telling you which line the error is on. That would help narrow it down. That's a LOT of code to try and digest.
×
×
  • 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.