Jump to content

tqla

Members
  • Posts

    366
  • Joined

  • Last visited

Everything posted by tqla

  1. so your issue was concatenation. glad you got it working.
  2. Are you replacing customerservice@sentuamessage.com with a real email address?
  3. With godaddy I believe the "from" email has to actually exist.
  4. Each time the form appears you need to include a hidden field containing that records id. Something like this: <input type="hidden" name="id" value="<?php echo $id ?>"> Then change your query to: DELETE FROM $tbl_name WHERE id = $_POST['id']; Of course, format it in a way where you won't get errors. My formatting isn't like yours but you get the idea.
  5. tqla

    Array help

    Great suggestion! Thank you requinix! I made that change and it worked out.
  6. I have a session array that is added to by a form. Here it is when the form is submitted twice. It can grow larger and larger in a single session but the keys are always the same. What I need to do is check all the arrays to see if the key called Form matches a variable and if it matches then I will use that values in that particular array. array 0 => array 'Age' => string '20' (length=2) 'City' => string 'New York' (length= 'Your_name' => string 'Jim' (length=3) 'Friend1' => string 'Joseph' (length=6) 'Friend2' => string 'Waldo' (length=5) 'Form' => string 'help' (length=4) 1 => array 'Age' => string '25' (length=2) 'City' => string 'Sun Valley' (length=10) 'Your_name' => string 'Susan' (length=5) 'Friend1' => string 'Rick' (length=4) 'Friend2' => string 'Joe' (length=3) 'Form' => string 'welcome' (length=4) I know that I can do something like this to check the first one. $key = 'help'; $array = $_SESSION['array']; if($array[0]['Form'] == $key){ echo "We have a match"; } But how can I automatically cycle through [0], [1], and so on until I find a match? Thank you.
  7. Thank you all. SocialCloud, I'm glad it works in your (most likely later) version of PHP. Troubling that that sytax fails in some versions. PFMaBiSmAd and requinix, thank you for the 2038 info, the 32bit limitation it is indeed concerning.
  8. Hello. I do not need to know how to write this another way. I just am curious as to why this happens. Why does strtotime() print the expected result when I add 25 years: <?php $thedate = date('D M Y', strtotime("+25 year")); echo $thedate; ?> But it fails to print the expected result when I add 26 years. Instead it reads "Wed Dec 1969" <?php $thedate = date('D M Y', strtotime("+26 year")); echo $thedate; ?> Is it my version of PHP? Is there a 25 year limit? Does this happen on your system? Thanks.
  9. Oh I know, I had no problem echoing the entire array as expected. Thanks Barand.
  10. I was using nested foreach loops. Worked fine if I wanted to echo everything. But I did not. Solution: one foreach, $data[1] as $row.
  11. Yes I do Barand. Thanks again!
  12. Ah ha. Thanks jesirose.
  13. Thank you Barand. Can the loop be made to echo only "c d"?
  14. Obviously print_r prints this: Array ( [0] => Array ( [0] => a [1] => b ) [1] => Array ( [0] => c [1] => d ) [2] => Array ( [0] => e ) ) My question is how do do a foreach loop on this part: [1] => Array ( [0] => c [1] => d )
  15. Hello, I have an array called $data that looks like this. Array ( [0] => Array ( [0] => a [1] => b ) [1] => Array ( [0] => c [1] => d ) [2] => Array ( [0] => e ) ) I wish to do a foreach look on this part: [1] => Array ( [0] => c [1] => d ) When I do foreach ($data as $row)... I get everything in the array. When I do foreach ($data[1] as $row)... or foreach ($data['1'] as $row)... I get nothing. What is the proper way? Thanks.
  16. Solved. Was missing 'attributes()'. $test = (string)$xml->pix[0]->attributes()->pic; echo $test; Thanks requinix.
  17. Hello requinix. I do this: $xml = simplexml_load_file('test.xml'); print_r($xml); and I get the array in my original post. I add this but it doesn't print a value for $test: $test = (string)$xml->pix[0]->pic; echo $test; Is this what you mean? Thanks.
  18. How do I echo a single value on a SimpleXMLElement Object? For example "Tooltip Text 2". SimpleXMLElement Object ( [pix] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [pic] => image1.png [alt] => Tooltip Text 1 [desc] => Content 1 ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [pic] => image2.png [alt] => Tooltip Text 2 [desc] => Content 2 ) ) ) ) Thanks.
  19. tqla

    PHP XML HELP

    Works after all (syntax error). Thanks!
  20. tqla

    PHP XML HELP

    It seems to be something about the way the xml is formatted. Your suggestions work great with this: <catalog> <book id="bk101"> <author>Gambardella, Matthew</author> <title>XML Developer's Guide</title> </book> <book id="bk102"> <author>Ralls, Kim</author> <title>Midnight Rain</title> </book> </catalog> But I cannot get a result with this: <pictures> <pix pic="image1.png" alt="Tooltip Text 1" desc="Content 1" /> <pix pic="image2.png" alt="Tooltip Text 2" desc="Content 2" /> </pictures> More help appreciated. Thanks.
  21. tqla

    PHP XML HELP

    Testing your suggestions
  22. I am working with an XML file that is formatted like this: <pictures> <pix pic="image1.png" alt="Tooltip Text 1" desc="Content 1" /> <pix pic="image2.png" alt="Tooltip Text 2" desc="Content 2" /> </pictures> I need to load the file and make it into an array so that I can get the "pic", "alt" and "desc" information so that I can echo them. I try this but it prints nothing: $xml = simplexml_load_file('file.xml'); print_r($xml); This prints nothing too: $data = file_get_contents('file.xml'); print_r($data); I figure it's because of the format of the xml file but I cannot change that. All help appreciated.
  23. Hello. I am validating my form with jquery.validate.js. When I use a regular submit button like this the form works fine and the fields get looked at and validation messages appear as expected. <input type="submit" value="Submit" /> But, after it validates the form gets submitted. I don't want that, I want to call a function instead because I am using AJAX to send the field values to a script. When I use the following code for my submit button my AJAX function works as expected but no validation works, it just goes right to my function. <input type="submit" value="Submit" onclick="sendform(); return false;" /> But I want both to happen - first jQuery validation, then my AJAX function. I assume that I would need to put the "sendform()" function in the jquery.validate.js code but I do not know where to put it and every place I've tried so far fails. Anybody here familiar with the jquery.validate.js script? link: http://docs.jquery.com/Plugins/Validation Thanks in advance.
  24. Change if(!empty($var) and ($var != '')) to if(!empty($var) && ($var != ''))
×
×
  • 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.