Jump to content

Passing a values in URL


eldan88

Recommended Posts

Hey Guys. I am working on an API for automated voice application.

 

I was just wondering if it is possible to send a URL value with out assigning anything to it.

 

For example if someone presses a key on their telephone keypad, the application will go the following url <Gather action=\"confirmation_verificationphp?est_delivery_time\">

 

The "delivery_time" is not assigned to anything, I just want PHP to preform a set of actions when it gets the "delivery_time"

 

Below is a clear example

// When user enters a number on their telephone keypad it will go to "confirmation_verification.php?delivery_time"
  echo "<Gather action=\"confirmation_verification.php?delivery_time\" method=\"GET\" timeout=\"10\" finishOnKey=\"*\">";
                    echo say("Please enter your estimated delivery time");
                   echo "</Gather>";


Preform the set of actions when you get "delivery_time"
                   if($_GET['delivery_time']) {
                      $delivery_time =  $_GET['Digits'];
                      send_order_confirmation_email($order_number, $delivery_time );
                   }	
Link to comment
https://forums.phpfreaks.com/topic/284917-passing-a-values-in-url/
Share on other sites

It is possible, but you need the isset() method, your if condition will always be false if you do not assign a value to 'delivery_time' :

 

 

if($_GET['delivery_time']) {
$delivery_time = $_GET['Digits'];
send_order_confirmation_email($order_number, $delivery_time );
}   

 

Instead use

if(isset($_GET['delivery_time']))

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.