Hello,
I'm trying to use urlencode to convert the string: <a href="<?php print 'search.php?query='.quote_replace(addmarks($search_results['did_you_mean'])).'&search=1'?>">
Actually, i want to implement a search engine.
|-www
|- index.php
|- search directory
|- search.php
|- header.html
|- search_form.html
|- search_result.html
|- footer.html
search.php includes header.html,search_form.html,search_result.html etc.
I access search.php using: localhost/index.php/?page=search
search_form.html include button to search. And it call search.php using: <form action="index.php/?page=search" method="get">
. i'm not sure if it's right.
After submitting the search request, search.php calls search_result.html to show result. The code in search_result.html:
<a href="<?php print 'search.php?query='.quote_replace(addmarks($search_results['did_you_mean'])).'&search=1'?>"><?php print $search_results['did_you_mean_b']; ?>
It seems should work, but after i click the search button, the result url is index.php/?query=&search=1
. And i think it should be index.php/?page=search/?query=&search=1
.
So, i try to use urlencode to solve it. And i don't know if the idea is right.
Thanks a lot for your help.