Forums

Redirect after showing data

leo 21 Mar, 2008
I do use

The form is oke, it is sending data to DB, sending emails etc.
The thing i now run into is the follwing.

I am displaying the results to the user via code in the Onsubmit-after sending email field.

I do have the following redirect in it;
<?php
global $mainframe;

$custom_tag = '<meta http-equiv="refresh" content="10"; url=http://www.lvschilderwerken.nl" >';
$mainframe->addCustomHeadTag($custom_tag);
?>
<p>Geachte {fieldname}</p>
<p>Hartelijk dank voor het indienen van dit offerte verzoek.{fieldnames etc}</p>
After the redirect i do get the following error on the screen;

You are not allowed to access this URL directly, POST array is empty

I don't know what it is and how to deal with it.
Can you tell me what to do?

Greetz,
Leo<br><br>Post edited by: GreyHead, at: 2008/03/21 18:12
GreyHead 21 Mar, 2008
Hi Leo,

Looks to me as though there is a quote missing before the url url="http . . .

The message you are seeing is one generated by ChronoForms when the task=send url is clicked with an empty form - it's a little bit of spam prevention.

Bob
leo 22 Mar, 2008
Hi Bob,

Thank you for your answer but i just copied it at it is in the faq pages. But maybe you're right. I've changed it into;
<?php
global $mainframe;

$custom_tag = '<meta http-equiv="refresh" content="10"; url="http://www.lvschilderwerken.nl" >';
$mainframe->addCustomHeadTag($custom_tag);
?>
<p>Geachte <?php echo $_POST['geslacht'] ?> <?php echo $_POST['realname'] ?></p>
<p>Hartelijk dank voor het indienen van dit offerte verzoek.</p>
But, i'm sorry, with the same result. Still get the error message.

Do you have an other suggestion?
Leo<br><br>Post edited by: GreyHead, at: 2008/03/22 01:14
Max_admin 22 Mar, 2008
Hi Leo,

Try to remove those PHP lines ?

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
leo 23 Mar, 2008

Hi Leo,

Try to remove those PHP lines ?

Cheers

Max




What i tried was to make a redirect after showing the data of the form for 10 seconds.

Perhaps i did the wrong thing?

Can you tell me how to do it?
I've been searching in PHP forums but i am affraid to end up the same.
GreyHead 23 Mar, 2008
Hi Leo,

After a quick look that code looks as though it ought to work in Joomla 1.0.x - is that what you are using?

Bob
leo 23 Mar, 2008

Hi Leo,

After a quick look that code looks as though it ought to work in Joomla 1.0.x - is that what you are using?

Bob



Hi Bob,

I do use Joomla 1.5.1

Leo
GreyHead 24 Mar, 2008
Hi leo,

OK, that helps. I'm not sure that $mainframe->addCustomHeadTag($custom_tag) is supported in Joomla 1.5

I'll have a hunt around when I have a moment - I think that ChronoForms uses that somewhere so I can see what Max used in the 1.5 version.

Bob
GreyHead 24 Mar, 2008
Hi Leo,

Apparently it should still work though it's deprecated. The 'correct' Joomla 1.5 code is
global $mainframe;

$document =& JFactory::getDocument();
$customTag = . . .;
$document->addCustomTag( $customTag );
Bob
GreyHead 24 Mar, 2008
Hi Leo,

I fiddles around and solved it. The code you have works OK but use this syntax:
$custom_tag = '<meta http-equiv="refresh" content="10;url=http://www.lvschilderwerken.nl" >';
Note the 10;url bit especially, no spaces and no quotes.

Sorry for the misguidance earlier.

Bob
leo 24 Mar, 2008
Hi Bob,

I have changed the code into the one you offered.

<?php
$custom_tag = '<meta http-equiv="refresh" content="10;url=http://www.lvschilderwerken.nl" >';
?>


Could you tell me i did it the correct way ? Because it is not redirecting after 10 seconds!
Sorry for the trouble but i'm just a ono at PHP, sorry for that. And thanks again for your great help.
GreyHead 24 Mar, 2008
Hi Leo,

I only gave you the one line.In full it is:
<?php
global $mainframe;

$custom_tag = '<meta http-equiv="refresh" content="10;url=http://www.lvschilderwerken.nl" >';
$mainframe->addCustomHeadTag($custom_tag);
?>
<p>Geachte <?php echo $_POST['geslacht'] ?> <?php echo $_POST['realname'] ?></p>
<p>Hartelijk dank voor het indienen van dit offerte verzoek.</p>
Bob
leo 24 Mar, 2008
Hi Bob,

Thank you very much for you're support but it works just great.

Problem solved!!!!

Greetingz,
Leo
This topic is locked and no more replies can be posted.