A Weird Problem About Php Variable.
-
Hi there,
I am trying to implement this code into the page, so my client can query about his reports and show if there is one with the exact serial no. But when I use the variable “id”, it is redirecting to the link of; https://www.ozguncicek.com.tr/wp-content/uploads/Rapor4714.pdf
(Since your plugin’s shortcode is set forth as “id”)
But when I change the id variable to something else (for example ida).. this time it redirecting to only https://www.ozguncicek.com.tr/wp-content/uploads/Rapor.pdf
(See, without the serial number)
Right now this code is on the site, live; (which is directing to a link without serial number)
<?php if(isset($_POST['submit'])) { $ida = $_POST['ida']; echo "https://www.ozguncicek.com.tr/wp-content/uploads/Rapor".$ida.".pdf"; } ?> <form method="post" target="_blank" action="<? echo "https://www.ozguncicek.com.tr/wp-content/uploads/Rapor".$ida.".pdf"; ?>"> <input type="text" name="ida"><br> <input type="submit" name="submit" value="Sorgula"><br> </form>And working code is this; (But this is working with your plugin’s “id” variable :p)
<?php if(isset($_POST['submit'])) { $id = $_POST['id']; echo "https://www.ozguncicek.com.tr/wp-content/uploads/Rapor"."$id".".pdf"; } ?> <form method="post" target="_blank" action="<? echo $_SERVER['PHP_SELF']; ?>"> <input type="text" name="id"><br> <input type="submit" name="submit" value="Sorgula"><br> </form>Could you please help me with this? I could not figure it out why ??
The page I need help with: [log in to see the link]
The topic ‘A Weird Problem About Php Variable.’ is closed to new replies.