Jump to content

H, first time here. Hope to get some help


Most-Wanted

Recommended Posts

Ok, so i have searched everywhere for tips on how to include variables inside of a Redirecting url. I am lost.

 

My code is here:

 

<?php

ob_start();
#************
#Get all the form data
#************

$name = $_POST['customersname'];
$number = $_POST['number'];
$amount1 = $_POST['amount'];
$amount2 = $_POST['amount2'];
$agentnum = $_POST['agentidnumber'];
$returnlink = $_POST['returnlink']; 
$link = 'http://sapitalk.com/resellers/web_agent/agent_webservice.php?agent_key=$agentnum&customername=$name&phonenumber=$number&cardamt=$amount1&cardamt2=$amount2&returnlink=$returnlink';

#************
#Check Data
#************

if ( $name == "" ) {
#header( 'Location: http://www.cimiworldradio.com/sipitalk.php?name=no' ) ;
 echo '<META HTTP-EQUIV="Refresh" Content="0; URL=http://www.cimiworldradio.com/sipitalk.php?name=no">'; 
} 
if ( $number == "" ) {
#header( 'Location: http://www.cimiworldradio.com/sipitalk.php?number=no' ); 
 echo '<META HTTP-EQUIV="Refresh" Content="0; URL=http://www.cimiworldradio.com/sipitalk.php?number=no">'; 
} 
if ( $amount1 == "" ) {
#header( 'Location: http://www.cimiworldradio.com/sipitalk.php?amount=no' ) ;
 echo '<META HTTP-EQUIV="Refresh" Content="0; URL=http://www.cimiworldradio.com/sipitalk.php?amount=no">';  
} 

#************
#Contunue
#************
#printf("<script>location.href='http://sapitalk.com/resellers/web_agent/agent_webservice.php?agent_key= . $agentnum . '&customername=' . $name . '&phonenumber=' . $number . '&cardamt=' . $amount1 . '&cardamt2=' . $amount2 . '&returnlink=' . $returnlink'</script>");
echo "<META HTTP-EQUIV="Refresh" Content="0; URL=http://sapitalk.com/resellers/web_agent/agent_webservice.php?agent_key=" . $agentnum . "&customername=" . $name . "&phonenumber=" . $number . "&cardamt=" . $amount1 . "&cardamt2=" . $amount2 . "&returnlink=" . $returnlink . ">";
#header( "Location: http://sapitalk.com/resellers/web_agent/agent_webservice.php?agent_key= . $agentnum . '&customername=' . $name . '&phonenumber=' . $number . '&cardamt=' . $amount1 . '&cardamt2=' . $amount2 . '&returnlink=' . $returnlink' ") ;
#echo "http://sapitalk.com/resellers/web_agent/agent_webservice.php?agent_key=$agentnum&customername=$name&phonenumber=$number&cardamt=$amount1&cardamt2=$amount2&returnlink=$returnlink";

?>

 

The error i am getting is here:

 

echo "<META HTTP-EQUIV="Refresh" Content="0; URL=http://sapitalk.com/resellers/web_agent/agent_webservice.php?agent_key=" . $agentnum . "&customername=" . $name . "&phonenumber=" . $number . "&cardamt=" . $amount1 . "&cardamt2=" . $amount2 . "&returnlink=" . $returnlink . ">";

 

I can't find a way to set this up so the variables are inputed and the link redirects. I get this error:

 

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home1/cimiworl/public_html/sipiitalk.php on line 37

 

Hopefully someone could give me some tips. Thanks!

Link to comment
https://forums.phpfreaks.com/topic/216596-h-first-time-here-hope-to-get-some-help/
Share on other sites

There were unescaped double quotes within a double quoted string, and there's no real need for all that concatenation.

 

echo "<META HTTP-EQUIV=\"Refresh\" Content=\"0; URL=http://sapitalk.com/resellers/web_agent/agent_webservice.php?agent_key=$agentnum&customername=$name&phonenumber=$number&cardamt=$amount1&cardamt2=$amount2&returnlink=$returnlink\">";

There were unescaped double quotes within a double quoted string, and there's no real need for all that concatenation.

 

echo "<META HTTP-EQUIV=\"Refresh\" Content=\"0; URL=http://sapitalk.com/resellers/web_agent/agent_webservice.php?agent_key=$agentnum&customername=$name&phonenumber=$number&cardamt=$amount1&cardamt2=$amount2&returnlink=$returnlink\">";

 

Thanks so much! Very quick reply! Thanks for that link as well. I think i just learned some new things!

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.