FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » How to create a user friendly URL with parameters?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: How to create a user friendly URL with parameters? [message #182537 is a reply to message #182536] Sun, 11 August 2013 20:50 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 8/11/2013 4:09 PM, carapooz(at)gmail(dot)com wrote:
> Hello,
> I have a search form using a POST method (not a GET one!).
> After recieving the request I would like to have my page (the same page) be reloaded on the server with user friendly url in the browser address box.
> http://exemple.com/spage.php?id=12&ci=13
>

So why not use the GET method for your form and save yourself the trouble?

> I did it like this:
>
> ...
>
> page = 'spage.php?id=' . $received['sloc'] . '&ci=' .$received['sdef'];
>
> if($redirect == 1){
> header('Location: ' . $page);
> exit();
> }
> ...
>
> And it works on my local computer but it does not work on Godaddy server.
> How it can be done? And wthat is the best way to make a transfer from POST to GET?
>
> Thank you.
> A+
>

You didn't give the entire code, so first of all we don't know what
$redirect contains.

But the most common problem with this type of code is the headers
already being sent. This will be done by ANYTHING (even white space)
being sent before the header() call. For instance, is GoDaddy inserting
something ahead of your code? Or do you have ANYTHING which will send
output before your header call (even a blank line at the start of the
file will do this).

If you still can't find your problem, immediately after the <?php in
your file, add:

error_reporting(E_ALL);
ini_set('display_errors', '1');

What message(s) is(are) displayed?

Note: Don't leave this code in on a production system.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Please evaluate my cache-control & pragma etc. code
Next Topic: Re: Sexy CATHERINE ZETA JONES Sex Scandals
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Dec 05 02:09:58 GMT 2024

Total time taken to generate the page: 0.04068 seconds