OT: Php redirect query

OT: Php redirect query

am 26.06.2007 21:48:03 von Animesh Kumar

Hello All:

This question is slightly off-topic, but hopefully someone has fiddled
with this problem before.

A php script poem_fb.php is a separate file. I call it using a form to
submit comments. Then the php form gives a redirect url which causes an
extra reload of the page where the user is already present.

Is it possible to get rid of the extra re-load? What is a better way to
call the php script so that this reload can be avoided?


More details:
-------------

Javascript: Needed (nothing funky there, except some onclick events).

URL: http://stutimandal.com/gif_misc/indra_krta_rama_stotram.php

The page can be found at the above link (sorry about bad aesthetics, I
need to improve the icons and the floated layer style).

Clicking on contact reveals the form. Clicking on abort removes the form
away. Clicking on Send will send an email to me (don't worry about
flooding me, just say alt.html in the text and I will delete the email).

Right now validation is not present (in a proper way). I will add the
validation script later.

I can email the php script if needed.

Best regards,
Animesh

Re: OT: Php redirect query

am 26.06.2007 22:33:58 von Shion

Animesh K wrote:
> Hello All:
>
> This question is slightly off-topic, but hopefully someone has fiddled
> with this problem before.

This had been far better on a javascript group


> A php script poem_fb.php is a separate file. I call it using a form to
> submit comments. Then the php form gives a redirect url which causes an
> extra reload of the page where the user is already present.

You see to that the poem_fb.php generates the page you want to have displayed,
instead of the header() you can have include_once('index.php');



--

//Aho

Re: OT: Php redirect query

am 26.06.2007 22:38:57 von Shion

Animesh K wrote:
> Hello All:
>
> This question is slightly off-topic, but hopefully someone has fiddled
> with this problem before.

This had been better posted at alt.php or some javascript nesgroup, depending
on what kind of solution you want


> A php script poem_fb.php is a separate file. I call it using a form to
> submit comments. Then the php form gives a redirect url which causes an
> extra reload of the page where the user is already present.
> Is it possible to get rid of the extra re-load? What is a better way to
> call the php script so that this reload can be avoided?

Of course, all depends on what kind of solution you want.

1. You can poem_fb.php include the page you want to show.
2. You can redirect the form to the page you want to show, if a $_POST value
been got by the page, it includes the poem_fb.php
3. you use ajax to send the comment, this way the user stays on the original
page all the time.


--

//Aho

Re: OT: Php redirect query

am 26.06.2007 23:26:12 von Animesh Kumar

J.O. Aho wrote:
> Animesh K wrote:

>
> Of course, all depends on what kind of solution you want.
>
> 1. You can poem_fb.php include the page you want to show.
> 2. You can redirect the form to the page you want to show, if a $_POST value
> been got by the page, it includes the poem_fb.php
> 3. you use ajax to send the comment, this way the user stays on the original
> page all the time.
>
>

I am using #2 in the above list, I think. I want a no-reload type
solution (mimicking Ajax) using php. I wonder if that is possible.

Thanks for the reply,
Animesh