Most-Wanted Posted October 22, 2010 Share Posted October 22, 2010 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 More sharing options...
AbraCadaver Posted October 22, 2010 Share Posted October 22, 2010 http://us.php.net/manual/en/language.types.string.php Link to comment https://forums.phpfreaks.com/topic/216596-h-first-time-here-hope-to-get-some-help/#findComment-1125357 Share on other sites More sharing options...
Pikachu2000 Posted October 22, 2010 Share Posted October 22, 2010 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\">"; Link to comment https://forums.phpfreaks.com/topic/216596-h-first-time-here-hope-to-get-some-help/#findComment-1125358 Share on other sites More sharing options...
Most-Wanted Posted October 22, 2010 Author Share Posted October 22, 2010 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! Link to comment https://forums.phpfreaks.com/topic/216596-h-first-time-here-hope-to-get-some-help/#findComment-1125365 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.