Page 2 of 2 First 12
  • Jump to page:
    #16
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    7
    Rep Power
    0
    Originally Posted by BarryG
    Correct html for javascript is
    Code:
    <script type="text/javascript">
    language has been deprecated in favour of type

    http://www.w3.org/TR/REC-html40/interact/scripts.html
    does javascript have to do with any looping problem? still didnt get the looping work
  2. #17
  3. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,232
    Rep Power
    593
    Nothing. That was a nonsequitor with respect to your looping issue. However, you should fix the deprecated syntax as an aside. Did you dump $_POST and see the values you are expecting?
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #18
  5. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2004
    Posts
    2,868
    Rep Power
    368
    Originally Posted by BarryG
    Correct html for javascript is
    Code:
    <script type="text/javascript">
    language has been deprecated in favour of type

    http://www.w3.org/TR/REC-html40/interact/scripts.html
    which has been deprecated in favour of NOTHING i.e.:

    <script> (HTML5!)
    Last edited by paulh1983; March 25th, 2013 at 07:41 AM.
  6. #19
  7. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2004
    Posts
    2,868
    Rep Power
    368
    PHP Code:
    foreach ($tel as $_POST['CTL_TEL']) {


    $status $gsm_send_sms->send($tel $_POST["CTL_MSG"]); 
        

    if (
    $status) {
        echo 
    "Message sent\n";
    } else {
        echo 
    "Message not sent\n";
    }

    this is wrong..

    on the previous page if you allow users to have more than one telephone number.. the input should have this code

    Code:
    <input type="text" name="tel[]" />
    <input type="text" name="tel[]" />
    NOTICE name=.. part.

    then on php page do:

    $tel_nos = $_POST['tel'].

    then foreach ($tel_nos as $tel) {
    $status = $gsm_send_sms->send($tel , $_POST["CTL_MSG"]);
    }

    note the status in this foreach ideally should be an array or a string that you append to i.e. status .= ... so that you know the status of all numbers and not just the last one..
  8. #20
  9. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,232
    Rep Power
    593
    The syntax for 'CTL_TEL' in the form was fixed in a previous post so the loop was correct. There is no difference between the two suggestions. However, the issue currently is that $_POST['CTL_TEL'] apparently does not contain what the OP expects. We need the dump to see what is really there.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  10. #21
  11. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2004
    Posts
    2,868
    Rep Power
    368
    i was referring to this:

    foreach ($tel as $_POST['CTL_TEL']) {

    usually it is the other way around i.e. foreah ($post as $tel)...
  12. #22
  13. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,232
    Rep Power
    593
    Sorry, yes I had my syntax backwards (too much jumping between Perl and PHP lately). Perl has the syntax the other way (array reference last). :$
    PHP Code:
    foreach ($_POST['CTL_TEL'] as $tel) { 
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  14. #23
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Location
    Sydney Australia
    Posts
    178
    Rep Power
    83
    Originally Posted by paulh1983
    which has been deprecated in favour of NOTHING i.e.:

    <script> (HTML5!)
    Um.. not really.

    Originally Posted by W3c says
    The default, which is used if the attribute is absent, is "text/javascript".
    http://www.w3.org/html/wg/drafts/html/master/scripting-1.html#the-script-element


    Not the same as being deprecated, it's just not required if you want the default.
Page 2 of 2 First 12
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo