Jump to content

Muddy_Funster

Members
  • Posts

    3,372
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Muddy_Funster

  1. The only reason I can think that it would be coming from your server is if it's a threading issue, I'm not sure how cURL forks requests so it may be that it's flooding your servers connection threads. If that's the case you'll need someone else to help you out, and probably the same person will point out that I have used completly erronious language in my atempt to describe an issue I know very little about Do let us know how you get on with the data testing though.
  2. Your problem is that there is already an existing primary key value in user_location that matches the value you are trying to insert. Here, this should help: http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html
  3. hmmm 1) I can't find your loop in that code :-\ 2) is the internal server error being thrown by your server or is it returned through the curl from the remote server? 3) have you tried scraping any other sites with your script to make sure it's not some form of DoS deffense on the remote end?
  4. what's your error reporting set to? you should be getting a screen full of "Warning: Undefined Constant xxx assuming 'xxx'" if it's set to all. When addressing array values, unless the key is actualy a defined constant, you should always wrap in single quotes so instead of if($_GET[deposit_complete]){ if($temp[sentwelcome] == "0"){ You should have if($_GET['deposit_complete']){ if($temp['sentwelcome'] == "0"){ It should still run -all be it unhappily- with your own array values, but superglobals can do some funny things at times ($_GET is a superglobal by the way) also I see this here: if($register_error == "none"){ }else{ and kind of need to ask you: what's the point in that then? and another thing, when you are accessing array key values within pased strings you should wrap them in {} - $query = mysql_query("UPDATE `temp_users` SET `sentwelcome` = '1' WHERE `ip` = '{$temp['ip']}'"); Let's start with those changes and see what happens
  5. dude, seriously : use [ php] [ /php] BB tags around your code, it makes a massive difference. Also, could you maybe go into some detail about what it's not doing, when it's not doing it, what it's doing instead and how much of what it is supposed to be doing is going ok? to think of your script in an automotive sense: saying "my code broke down somewhere in my page" is like calling up a rescue company and saying "my car broke down somewhere in this country". They may get to your car, but it's going to take a lot longer than if you give town/city, neerest landmark, street name, how many miles down that rode you are, color of nearest parked vehicle etc. etc. etc. You see, by taking the time and helping us, we in turn will need to spend less time before we can help you.
  6. as I have no idea which line is 55, or what loop your talking about I can't be sure, but I suspect it's because you can only have one else for each if, you can however have as many elseif{}'s as you like. Also, you can UPDATE 2 tables using a single statement, look into UPDATE with JOIN.
  7. a flag is just a term, don't worry about it, just alter your links to be like: <td><a href="TaxiEntry1.php?Quote_ID='.$qid.'&flag=a">Accept</a> <a href="decline.php?Quote_ID='.$qid.'&flag=d">Decline</a></td>
  8. VB?!? I hear you can get a cream for that...oh, wait......no, you can't no it's all still PHP and SQL I don't have time for a full CASE breakdown for the SQL, but here, see what you think of this: if(isset($_POST['nextbtn'])){ $cache[1] = trim($_POST['cache1']); $cache[2] = trim($_POST['cache2']); $cache[3] = trim($_POST['cache3']); $cache[4] = trim($_POST['cache4']); $cache[5] = trim($_POST['cache5']); $cache[6] = trim($_POST['cache6']); foreach($cache as $value){ $value = mysql_real_escape_string($value); } $qry = "SELECT cachInfoID, cacheCode FROM cachInfo WHERE cacheInfoID BETWEEN 1 and 6"; $result = mysql_query($qry) or die (mysql_error()); while($row = mysql_fetch_assoc['$result']){ $keyVal = $row['cachInfoID'] -1; $dataset[$keyVal] = $row['cacheCode']; } foreach($cache as $k => $v){ if ($v != $dataset[$k]){ $url = "/register-cache.php?error=true"; header("Location: $url"); exit; } //do whatever for all matching results
  9. then adapt each link to include a flag for accept/decline and use the if(isset($_GET['flag'])){ if($_GET['flag']== 'a'){ //Update with accept } elseif($_GET['flag']=='d'{ //update with decline } else{ echo "stop messing about with the address bar!"; } }
  10. 1 - your best solution would be to use a regular expression replacement on your inputs. 2 - run updates replacing all instances of one with another.
  11. arrays would be better. and you should see if you can think of a way to use only 1 query to check all values....i'm thinking a SELECT CASE would be the best way for that.
  12. I see you still havn't read the rules then.... this: <input type="submit" value="Upload" /pics> should not contain the word pics. this: $target = "/pics"; could require a trailing / this: $target = $target . basename( $_FILES['uploaded']['name']) ; $filename = $target . basename( $_FILES['uploaded']['name']) ; $path = $target = "/pics"; is wrong, $target should not be changed and $path need not be created as it's just the same as $target will be after you don't change it. this: $mysql_path = $path."/".$filename; is going to set $mysql_path to /pics/picsfilename.ext - just use $filename, delete $path this if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) needs to have $target replaced with $filename. and that's just at a glance, make those changes and let us know how it goes.
  13. need a little more info regarding your current page logic to be certain, but something like this: if(isset($_GET['Quote_id'])){ //update database }
  14. Just checked the layout on my function, I think it's the order you have things in your header, this is the working order I use : $message .= "Content-type:application/octet-stream;"; //set content type to suitable type for attachment (octet-stream is for generic binary data other are available) $message .= "name=\"$fName\"".$e; //set the file name $message .= "Content-disposition:attachment;"; //use attachment to infer data that is being passed as a file $message .= "filename=\"$fName.xml\";".$e; //set the filename as it will be recieved $message .= "Content-transfer-encoding:base64".$e.$e; // encode the file for transfer $message .= $attachment.$e.$e; // add attachment contents $e contains \n for line break.
  15. newsletters should either be fed using rss/atom/etc to client subscriptions (most every mail client supports RSS feeds) or if going as a mail item, bundled in the bcc using the multiple address method with a single message to a dummy address in the to header. This reduces server load and network bandwidth.
  16. reading and adhearing to the rules, as well as not behaving like an ass on too many espresso's will get you far more productive responses than hijacking a thread. There is nothing wrong with your currently open thred, I could post a reply there if I wanted to. and before you even think about starting, this IS me helping you.
  17. ahh....yeah, that doesn't reliably work in practice though. I only spent two full days trying before I managed to get a working function using only the \n and not the \r\n, and it may very well be down to something as distant as how windows handles a new line over how linux does, but I'm just sticking with what I know.
  18. just about, because you are addressing an array value use {} around it: $to = "{$slide[email]}; [email protected]";
  19. your not assigning $lang to $_GET['lang'] before you check it.
  20. it could be a problem with the file loading, try sending some raw html as the attachment (just remember to change the Content-Type for the attachment before you send it. Also, add another \n after the attachment so it looks like this: // Edit content type for different file extensions $header .= "Content-Type: text/html; name=\"test.html\"\n"; $header .= "Content-Transfer-Encoding: base64\n"; $header .= "Content-Disposition: attachment; filename=\"".$file_name."\"\n"; $att= "<html><head><title></title></head><body>Test attachment for mail delivery</body></html>"; $header .= $att."\n\n";
  21. No, don't loop the mail function to send the same message to multiple recipients. Either add a cc or bcc header to the mail that you are sending. Or just add multiple addresses in the to header seporated with either commas or semi-colons depending on the mail servers setup.
  22. nope, your just circumventing the point that scooshta was making, and efectivly performing what his function does manualy and without the use of the output buffer.
  23. the specification for what? because the only reliable way I could get a multipart message to send when writing my mail function was to use \n and NOT \r\n
  24. you still have your Content-type declaration for the mail body commented out (and set to text/plain), try commenting out the base64 encoding line for the attachment, you don't need to encode it to send it, just to see if it will open.
  25. Your way works because you have completly detatched the use of <pre> from the return function that you are calling. Your echoing the <pre> tags as totaly indipendant entities, you could, in theory, do this with anything.
×
×
  • 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.