Last post Jul 20, 2011 06:18 PM by MtheK
Jul 06, 2011 07:32 PM|MtheK|LINK
I programmed my website using visual basic code (via microsoft expression web) and need to post information to a remote location using a php page. How do I take variables from my visual basic code and transfer them to my php code? I was thinking sessions
would work, but I haven't figured it out yet.
Jul 06, 2011 07:35 PM|senthilwaits|LINK
You can use Query strings. Pass the values in the URL separated by "&" and these values are accessible from PHP
Jul 06, 2011 08:42 PM|MtheK|LINK
Thanks for getting back to me so quickly.
My variables change depending on what the user is doing. Is there a way to pass that unknown value through using a query string? if so, how is this accomplished?
For example, my user selects items that they want to buy, and the total is kept in a vb variable. I then need to pass that total to a php page. How would I do this?
Jul 06, 2011 09:48 PM|senthilwaits|LINK
How are you redirecting the user to a PHP page. If it with "Response.Redirect" you can very well concatenate the total value as query string.
private void btnSubmit_Click(object sender, System.EventArgs e)
Response.Redirect("Webform2.php?Name=" + this.txtName.Text + "&LastName=" + this.txtLastName.Text);
Jul 13, 2011 07:51 PM|MtheK|LINK
Thanks so much, I am sorry for not replying sooner.
I have done some research etc., and have a slight problem. My button implements the following when it is clicked:
Sub QueryString(s As Object, e As EventArgs)
Response.Redirect("sim.php?Name=" + lblTotal1.Text)
And redirects to a php page with the following code:
$amount = echo $_GET["Total"];
<form method='post' action="[theurlthatipostto]">
<input type='hidden' name="x_amount" value="<?php echo $amount?>" />
When I run it, I get this error in the browser:
Warning: Unknown: It is not safe to rely on the system's timezone settings. You
are *required* to use the date.timezone setting or the
date_default_timezone_set() function. In case you used any of those methods and
you are still getting this warning, you most likely misspelled the timezone
identifier. We selected 'America/Denver' for '-6.0/DST' instead in
G:\wwwroot\mywebfile\store\sim.php on line 5 Parse error: syntax error,
unexpected T_ECHO in G:\wwwroot\mywebfile\store\sim.php on line 5
Line 5 being $amount = echo $_GET["Total"];
Again, I really appreciate this
Jul 13, 2011 10:58 PM|senthilwaits|LINK
To solve that issue
You can edit your php.ini file and put in the following line:
date.timezone = "America/Anchorage"
You can find valid time zone strings athttp://nl3.php.net/manual/en/timezones.php
For more details on this error pls refer. You can find a couple of solutions for the same issue
Jul 16, 2011 10:48 AM|MtheK|LINK
Thanks. That limited the error down to this:
Parse error: syntax error, unexpected T_ECHO in mywebsite\store\sim.php on line 5
Line five is the line below:
btw, the <?php ... ?> and
<form> ... </form> tags are the only code in the page.
Jul 20, 2011 06:18 PM|MtheK|LINK
I have solved it, and I apologize for drifting away from the asp.net end of it. I simply took the "echo" out of the line, and now it's simply "GET" ing the querystring variable!
Thanks for all your help!