I am trying to pass a variable to another page on a https:// connection without much success. Below is the query

https://mydomain.prefix/secure/myfile.php?claim_id=12345678

I then try and retrieve it using:

$claim_id=trim(mysqli_real_escape_string($dbc, $_GET['claim_id']));

This unfortunately does not work and I was wondering if it was the ssl that is stopping this. If so, how can I pass this variable to my page from an a href link ?

有帮助吗?

解决方案 2

Just to resume a concrete answer to this question:

If you're having a problem like this look somewhere else, not in your HTTPS setup or PHP GET request and parameters.

I have a problem like this, everything worked on HTTP and when I migrate the system to HTTPS not. I was not receiving the GET variable that I was expecting. After several hours of trying to find some problem related with the HTTPS setup and PHP config and code, the problems turns to be that I was not receiving the GET variable because a JS library, included in the HTML header, was not being included due to new restrictions in FF23 ( https://blog.mozilla.org/tanvi/2013/04/10/mixed-content-blocking-enabled-in-firefox-23/ ). I change the JS include to HTTPS and everything works again.

The solution to this particular question(from Sideshow) turns to be a database problem.

Hope that helps!

其他提示

This unfortunately does not work

....is not a meaningful description of the outcome. There's nothing intrinsically wrong with the code.

Try replacing

$claim_id=trim(mysqli_real_escape_string($dbc, $_GET['claim_id']));

with

if (is_resource($dbc)) {
  $claim_id=trim(mysqli_real_escape_string($dbc, $_GET['claim_id']));
  print "I got " . htmlentities($claim_id) . "<br />";
} else {
  print "I have no database handle! <br />";
}
print "ERR=" . mysql_error() . "<br />";

and show us what's actually happening.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top