Jump to content

grissom

Members
  • Posts

    166
  • Joined

  • Last visited

Everything posted by grissom

  1. Barand's solution is the most elegant and I like it a lot! But if you are a newbie, then the explode function is nice and simple, provided that the three values in your string are always separated by spaces. If that is the case, then $string = '(141442872453(2)) NV4852-SD (2)'; $parts = explode(' ', $string); Will split the string wherever there is a space and put the parts into an array called $parts so : $parts[0] = '(141442872453(2))' $parts[1] = 'NV4852-SD' $parts[2] = '(2)' The ID number is just $parts[1] To get the record number and quantity, you need to do a little more work. For that, you could try a function called substr ... like the others, I'll leave you now to look that one up in the manual and see if you can take it forward yourself. Good luck !
  2. Give this a go : $name = $_REQUEST['applicant_name'] ; $address = $_REQUEST['applicant_address'] ; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/plain;charset=iso-8859-1" . "\r\n"; $headers .= "From: " . $name . "\r\n" ."Reply-To: " . $name . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $success = mail("deleted_for_public_posting_purposes", "Online Job Application", $address, $headers);
  3. Kicken is right. So far, all you've done is built up some strings which will need to be "sent" somewhere, somehow. So there will have to be some more lines of code needed to do that. Kicken's suggestion to look over their examples or to ask their support is excellent.
  4. You could try building up a string like this : you will end up with a string you can then insert into your shortcode statement $string = ''; while ( $row = mysql_fetch_assoc( $result ) ) { $string .= $row['post_id'].','; } // take off the last comma $string = substr($string, 0, -1);
  5. You have two mysql queries in that bit of code, first job is to find out which one is failing. The first one looks pretty general, so my guess is that it's the second one, and there is nothing in the balances table where userId = '$userId'. You need to see what request is being made. One suggestion could be to squeeze in a line of code echo "SELECT points FROM balances WHERE userId = '$userId'"; just after that second mysql query and post back on here what comes up.
  6. I've not tested this so it could be completely wrong, but try putting value="" into your antispam field so it reads <input class="antispam" type="text" name="url" style="width:180px; height:17px; border-style:solid; border-width:1px; background-color:#000000; border-color:#BE0A0B " value ="" /> This way you know the variable is set and is an empty string before the form is posted
  7. From the bugs webpage I quoted, I found this at the bottom : "it's a bug affecting VC6 builds only. If you are affected just get VC9 builds from http://windows.php.net/download/ - you will also most likely need a VC9 or VC10 build of Apache from http://www.apachelounge.com/download/ VC6 is very old, outdated and not supported anymore, it's easy enough and free to upgrade to newer builds" So it looks like it affects some builds and not others It's not a function I use myself, I use my own version of the function which I poached off the php website a loooong time ago
  8. how about changing your mysql command a bit, something like : $startingpoint = $_GET['page']*10; $sql = "SELECT d_name,email,companies_not_paid,amount_not_paid FROM debtor ORDER BY d_name LIMIT $startingpoint, 10"; This will extract 10 records starting at the record = 10 * your page number Then have a "next button" on your page onClick = "document.location = where_we_are_now.php?page='.($_GET['page'] + 1).'" OK that's a little bit "pseudocode", and I have not tested it !! ... but hope its enough for you to get the general idea
  9. There is a bug on windows platforms !! https://bugs.php.net/bug.php?id=51184
  10. I would just do : $colour="red"; $myvar = 'The colour is '.$colour; This looks a bit too easy ! Have I misunderstood the question ?
  11. It breaks down like this : ref = sr_1_27 ie = UTF8 qid = 1386759643 sr=8-27 keywords = [there aren't any] UTF8 refers to the character coding (ie a bit like the "alphabet") used to encode the text. http://en.wikipedia.org/wiki/UTF-8 qid may refer to some "id" number sr = 8-27 may be short for "show search results 8 to 27" - but that's just my wild*ss guess As Ch0cu3r says, how Amazon process this info is their programmers knowledge to know, and ours to guess. This page will tell you a bit more about query strings http://en.wikipedia.org/wiki/Query_string hope any of this helps
  12. grissom

    php error

    Not necessarily, if it's inside a mysql statement
  13. grissom

    php error

    It looks like you are trying to do a mysql insert statement. From the bit I can see, try putting a single quote between the first left hand bracket and the first dollar sign. You may also need another right hand bracket right at the end of the line before the semicolon. If that fails, please can you post the full mysql query you are trying to execute. Good luck.
  14. Yes, which is why on my original post I clearly stated that I had already Googled around for an answer and had found that none of the methods I came across worked. Maybe there is no cast iron method of doing this ... which would be a shame.
  15. Sorry if I didn't make myself crystal clear. Of course, if you open a pdf file in an ascii text editor, it will look gibberish. What I am after is something to read the text that you would see if you opened it in a pdf reader.
  16. Hi all Basically, I'm looking for a way in PHP to read plain ascii text from out of any .pdf file I've Googled around a bit, but so far everything I've found suffers from either one of two drawbacks : 1. It requires me to install something on the server, which I'd rather not do, I'm looking for some PHP classes ideally 2. The recommended code, despite its promises, just doesn't work in practice! So basically, I'm asking does anybody know of anything to read text from a PDF file which they have used for themselves and can recommend. Many thanks.
  17. I don't know if it makes any difference, but in a one-line php statement, I still always include the semicolon at the end. So where you have <?php echo $content_body ?> I would put <?php echo $content_body; ?> You have a few examples of this kind of thing in your code. Maybe it's just me, but I would put the semicolon in there anyway.
  18. If your 7 days are consecutive, you could also put them in a loop.
  19. Just a suggestion but you could add an extra field in your mysql database called something like "thread_id" When an initial message is sent, the PHP code generates a brand new thread_id. If a message is replied to, then the PHP is set up to capture the thread_id and to re-post the reply with the same thread_id Then when you do the retrieval you can sort the replies out by thread_id Just a suggestion off the top of my head, there may be other better ways !!
  20. This function might help http://www.php.net/manual/en/datetime.createfromformat.php
  21. In your function content_update() remove the line which does the window location redirect and instead, put in a debugging line : echo 'The body content which I have just saved is '.$body.'<BR>'; and paste in this thread what it comes back with
  22. Just comment out this line // $send = mail("$mymail", "$cc", "$BoDy", "$FrOm"); and add a debugging line echo 'my mail = '.$mymail.' cc = '.$cc.' body = '.$BoDy.' from = '.$FrOm.'<BR>'; and copy and paste the relevant message that you get on the screen
  23. THANKS JAY That worked like a charm ! I can really admire someone who can sort out regex, whenever I try it's like doing a Rubik's cube in the dark. Thanks again.
  24. Hi folks, I'd be very grateful if you could help as regex is not my forte. I'm looking for something to strip any punctuation characters from the start of a string but retain any punctuation characters thereafter. For example &!%^:Hello World : it's a nice day ! would return Hello World : it's a nice day ! Many thanks !
  25. In which case, you don't need to use variables at all, just use your HTML as it stands, and, as MAq suggests, use the javascript onClick event. One little thing, your naming convention will probably work OK, but I'm paranoid and I try to keep names of elements different to any of the defined words in javascript or PHP. As a precaution, I'd recommend changing the name to : name = "my_color' (actually being British, I'd spell it "my_colour" but that's by the by)
×
×
  • 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.