www.webdeveloper.com
Results 1 to 2 of 2

Thread: PHP - cURL question

  1. #1
    Join Date
    Sep 2010
    Posts
    30

    PHP - cURL question

    Hi everyone - relatively new to cURL and am looking for some help.

    I'm simply looking to open a new php file in an existing parent window. This script below is part 2. Part one is an HTML form that posts to this PHP file (and works, submitting the text message through the Tropo API and to a cell number), I receive a SUCCESS message which is trying to save on my 'pute. But according to my reading I can use cURL to accept a TRUE condition and hence opern another page? This is MY understanding of it?

    <?php
    $token = '';
    $numbertodial = '';
    $msg = 'msg';
    $numToDial = 'numToDial';


    curl_setopt($curl_handle,CURLOPT_URL,'http://api.tropo.com/1.0/sessions?action=create&token='.$token.'&numbertodial='.$numbertodial.'&msg='.$msg. '&numToDial='.$numToDial);
    curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2);
    curl_setopt ($curl, CURLOPT_URL, "http://www.aosystemsgroup.com");
    curl_exec($curl_handle);
    curl_close($curl_handle);
    $curl_handle = curl_init(); curl_setopt($ch, CURLOPT_URL,"$aosystemsgroup.com");
    CURL url;

    ?>

  2. #2
    Join Date
    Sep 2013
    Posts
    221
    Well..,You can't use a server-side language (PHP) to control client-side behavior (forcing a new browser window for a hyperlink).Inspite you can go with javascript which is the easiest way.

    Javascript, however, is a client-side scripting language. You can use it to validate a form.

    A good practice in modern web applications, is to pre-validate a form using Javascript, then post to the PHP script only if the form is validated. If you need server-side features to validate your form, then you might post some data and request information from the server with Ajax first.
    You can also prefer Jquery.

    Hope this helps.
    strad solutionswww.stradsolutions.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles