Jump to content

dcro2

Members
  • Posts

    489
  • Joined

  • Last visited

    Never

Everything posted by dcro2

  1. If you add quotes around the proxy IP and add echo curl_error() at the end: Received HTTP code 403 from proxy after CONNECT You've used that proxy in your browser and it worked without authentication?
  2. I'm sure there's some that do allow connection to those ports but I don't personally know any.
  3. So not all outgoing connections are blocked, but they probably blocked connections to mail-related ports to prevent spam from being sent using their servers. I just tried it myself using a script I know that works. Sorry, but you'll have to find another host.
  4. You can't mix a normal if (/*something*/) { with an endif; I concur.
  5. having read this http://support.google.com/mail/bin/answer.py?hl=en&answer=78799 and successfully connecting myself as I said in my last post - yeah, we're sure Did you try that from the same host as the OP, http://powrhost.com ? It's a free host and an "unlimited" one at that, so I don't have much faith in them allowing (or maybe not having the capacity to support) outgoing connections to other servers. EDIT: to clarify, the error "Connection timed out" doesn't mean he got the login method wrong or anything. It simply means the PHP script tried to connect to that port but after however many second seconds gave up. I mean connect in the most raw form, just like opening a telnet session to port 993 on imap.gmail.com. If you were to do that, you immediately get: # telnet imap.gmail.com 993 Trying 209.85.225.108... Connected to gmail-imap.l.google.com. Escape character is '^]'. But this PHP script couldn't even get that far, so it seems it's something to do with the host.
  6. I should have noticed this before... you named both your to email address and your form input for address as $address. That causes mail() to fail. Also, you should be appending each line instead of overwriting the last. <?php //----------------------------------------------------- //----------------------------------------------------- $toemail= "[email protected]"; $subject = "Your subject"; //----------------------------------------------------- //----------------------------------------------------- $firstname = $_REQUEST['firstname']; $lastname = $_REQUEST['lastname']; $phone = $_REQUEST['phone']; $referred = $_REQUEST['referred']; $address = $_REQUEST['address']; $city = $_REQUEST['city']; $province = $_REQUEST['province']; $postal = $_REQUEST['postal']; $email = $_REQUEST['email']; $mime_boundary = md5(time()); $headers = "From: $firstname $lastname <$email>\r\n"; $headers .= "MIME-Version: 1.0\r\n"; //notice the dot before =, that means to concatenate $headers .= "Content-Type: multipart/alternative; boundary=$mime_boundary\r\n"; $message = "--$mime_boundary\n\n"; $message .= "New Web Registration: \n\n\n"; $message .= "First Name: $firstname \n\n"; $message .= "Last Name: $lastname \n\n"; $message .= "Phone Number: $phone \n\n"; $message .= "I was referred by: $referred \n\n"; $message .= "Address: $address \n\n"; $message .= "City: $city \n\n"; $message .= "Province: $province \n\n"; $message .= "Postal Code: $postal \n\n"; $message .= "Email Address: $email \n\n"; $message .= "--$mime_boundary--\n\n"; $mail_sent = mail($toemail, $subject, $message, $headers); if($mail_sent) header("location: paypal.html"); else die("Please try again"); ?> Honestly, you don't even need to do the mime boundary stuff since you're only sending plain text. And therefore the only header you should need is From.
  7. Are you sure your host allows outgoing connections? Try something simple to test it like: echo file_get_contents("http://google.com");
  8. You can't really schedule queries to happen with just php or mysql. Use cron. http://www.htmlcenter.com/blog/running-php-scripts-with-cron/ */15 8-20 * * * php /path/to/php/file.php It all depends on what host you're on, if you have cPanel, etc.
  9. You're right, but that means you need to select something other than `team_names_id` as value. If they don't have a dedicated id field I suppose you could just select `team_member` again? As in SELECT DISTINCT team_member as text, team_member as value FROM `team_members` WHERE team_names_id='%s'
  10. I didn't know it myself until I tried to test something else and forgot to add the enctype attribute. It was an interesting find.
  11. No. Just select a file and it'll send the file name when you submit.
  12. Sorry, it's kind of obvious now with just the first file. These 5 SQL queries are the same, so why would you expect different results? $query["team_members 1"] = "SELECT DISTINCT team_member as text, team_names_id as value FROM `team_members` WHERE team_names_id='%s'"; $query["team_members 2"] = "SELECT DISTINCT team_member as text, team_names_id as value FROM `team_members` WHERE team_names_id='%s'"; $query["team_members 3"] = "SELECT DISTINCT team_member as text, team_names_id as value FROM `team_members` WHERE team_names_id='%s'"; $query["team_members 4"] = "SELECT DISTINCT team_member as text, team_names_id as value FROM `team_members` WHERE team_names_id='%s'"; $query["team_members 5"] = "SELECT DISTINCT team_member as text, team_names_id as value FROM `team_members` WHERE team_names_id='%s'"; Each one fetches something different, so they should be SELECTing different fields.
  13. The only obvious thing was: But that shouldn't in theory prevent the email from being sent, it would just be mostly blank. You should try removing the Location header and turning error reporting on if possible at the top of your script. error_reporting(0); ini_set('display_errors', 1); If mail() does fail it will return false, but there's not really any way to know what went wrong without checking the mail logs on the system itself. Maybe you could try with a mailer class like SwiftMailer or PHPMailer. EDIT: just thought I should mention, try using \r\n for the headers instead of just \n and check your junk folder.
  14. Can you take out that part? That'll prevent the browser from actually uploading the file.
  15. If you'd rather not use another script for images, you could embed them into your page with the data URI scheme. There's obvious downsides to that though. echo "<img src='data:image/jpeg;base64,".base64_encode($row['jobimage'])."'>"; EDIT: just read that other post, that's one downside.
  16. First of all, wrap your strings in double or single quotes. That's probably causing the syntax error. Second, your logic needs some work. An elseif only matches if a previous if/elseif hasn't already been true. In other words, because $destination == "Tokyo" is true, your elseif($destination == "Tokyo" && $numNights >= 5) will never happen. Instead do something like: elseif ($destination == "Tokyo") { $airFare = 1575.00; $perNight = 240.00; if($numNights >= 5) { $airFare -= 200; //discount } }
  17. Is this form on the same host where you've gotten it to work previously? You don't check whether the mail() call was successful or not, so getting to the success page doesn't really mean anything. This host just might have it disabled.
  18. Well, it seems that the table `jobs` does not have an `image` field, so check that table. Shouldn't you be also be putting it in an <img> tag?
  19. dcro2

    extract

    String Operators $h1 = ""; foreach( $content as $item ) { $h1 .= $item.'<br />'; }
  20. I don't see any kind of output on that script... is it all on db_manager.php? Also, you should probably blank out the password in your post.
  21. I can't see where you initiated the <form>, but there is an attribute like this in it, right? enctype="multipart/form-data" Well, just remove that part from the <form> and all that will be submitted is the filename instead of the file.
  22. Is your problem that NO email gets sent or that the email contains no info? See my last post for the second one.
  23. The PHP you are calling on to retrieve values via AJAX (connection1.php) is returning the wrong things. For example, after choosing "desplaines11" in the Team Name, the values for the rest of the dropdowns come back as desplaines11. {"results":[{"text":"David Mecklenburger","value":"desplaines11"},{"text":"Gary Geppert","value":"desplaines11"},{"text":"David Chapa","value":"desplaines11"},{"text":"Kyle Fischer","value":"desplaines11"}]} If you don't know what that means, post the code for connection1.php so we can help you.
  24. POST/GET info is stored in the $_REQUEST variable by their input names (i.e. <input name="firstname">) $firstname = $_REQUEST['firstname']; $lastname = $_REQUEST['lastname']; //etc
  25. It seems to be having trouble with the element names with colons, so just $response = curl_exec($c); $response = preg_replace("/(<\/?)(\w+)[^>]*>)/", "$1$2$3", $response); $xml = simplexml_load_string($response); //missed semicolon here
×
×
  • 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.