1.11M Members

%22 in URL

 
0
 

I'm trying to use the GET method to pass a variable from one page to another

<?php
$id ++;
echo $id;
?>
<input type="hidden" name="quiz" value="venn" />
<?php
echo '<input type="hidden" name="id" value='.$id.'" />'
?>

In the URL it returns the value
http://localhost/moodle/logicquiz/quiz_start.php?answer1=&answer2=&answer3=&answer4=&quiz=venn&id=3%22

My question is this.......how can I get rid of the "%22" because I use the value given from the URL to obtain data from the database.

Thanks for your help
NH

Question Self-Answered as of 6 Years Ago
 
0
 

try urldecode

$newurl = urldecode(http://localhost/moodle/logicquiz/quiz_start.php?answer1=&answer2=&answer3=&answer4=&quiz=venn&id=3%22);

urldecode decodes any %## encoding in a given string..

I'm trying to use the GET method to pass a variable from one page to another

<?php
$id ++;
echo $id;
?>
<input type="hidden" name="quiz" value="venn" />
<?php
echo '<input type="hidden" name="id" value='.$id.'" />'
?>

In the URL it returns the value
http://localhost/moodle/logicquiz/quiz_start.php?answer1=&answer2=&answer3=&answer4=&quiz=venn&id=3%22

My question is this.......how can I get rid of the "%22" because I use the value given from the URL to obtain data from the database.

Thanks for your help
NH

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article