close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Page redirect not working

Thread began 3/28/2019 11:49 am by iain331081 | Last modified 5/12/2020 10:43 am by Ray Borduin | 689 views | 9 replies |

iain331081

Page redirect not working

I had a similar issue with a page not that long ago, which was broken because of spaces in the PHP code at the top of the page. I've had a look for stray spaces with this one, but haven't spotted any.

Its mostly working - the email is being sent when the form is submitted, and the form contents are correctly being inserted into a database table.

But I'm just getting a white screen with the same URL as the contact page, and its not redirecting.

I have attached a copy of the file below - if you can a look and see if you can spot what's causing this, that would be great.

Thank you!

Sign in to reply to this post

Ray BorduinWebAssist

Add this to the top of the page:

<?php
ini_set("display_errors",1);
?>

Maybe that will give you an error message and line number to go on. I can't see the problem on the page, so maybe the issue is with one of the include files.

Sign in to reply to this post
Did this help? Tips are appreciated...

iain331081

Thanks Ray - just been having a look. Looks like its something with the mail include, waue_contact_1.php.

Error is:

Catchable fatal error: Object of class WA_MAILOBJ could not be converted to string in /home/safariaw/public_html/webassist/email/waue_contact_1.php on line 62

Sign in to reply to this post

Ray BorduinWebAssist

You have a stray $ on line 59. Try deleting that and see if it helps.

Sign in to reply to this post
Did this help? Tips are appreciated...

iain331081

Thanks Ray - that was indeed the culprit.

Sign in to reply to this post

Philippe

Same problem,

Originally Said By: Ray Borduin
  Add this to the top of the page:

<?php
ini_set("display_errors",1);
?>

Maybe that will give you an error message and line number to go on. I can't see the problem on the page, so maybe the issue is with one of the include files.  


Hello Ray,

I have been looking for several days but there I am lost
I made an email form in which I entered the recipient's address with a body file with dynamic value and everything works fine.

But when I added a query in the contact page to display the name of the site nothing works and the redirection does not happen.
I got this error message:
Warning: Cannot modify header information - headers already sent by (output started at /home/foyercul/www/contactez-nous.php:26) in /home/foyercul/www/webassist/email/WA_Email.php on line 405

Then I moved this line at the top off the contact page <?php require_once("webassist/email/WA_Email.php"); ?>, as you can see in the file, this message disappeared but another one is displayed :
Fatal error: Call to a member function query() on a non-object in /home/foyercul/www/webassist/mysqli/rsobj.php on line 215

When I want the recipient e mail from database to send it to one or 2 recipients in bcc the email is not sent

I have a main site in php 5.4 which I rewrite with databridge and a mobile site in subdomain on the same shared server OVH in php 7.03 and the problem is the same.

I just removed this : $Email->addTo("webmaster@foyerculturel.org");
To this : $Email->addTo("".($site->getColumnVal("mailcontact")) ."");
i received the email but i got this error and redirection don't work i have à blank page

Warning: Cannot modify header information - headers already sent by (output started at /home/foyercul/www/contactez-nous.php:34) in /home/foyercul/www/webassist/email/WA_Email.php on line 405
As soon as I remove any request everything is ok.

Sign in to reply to this post

Ray BorduinWebAssist

You have a blank line of code on line 33 like:

?>

<?php


A redirect can't happen after anything is written to the page including a blank line. Update it and remove that line so it is:

?>
<?php
Sign in to reply to this post
Did this help? Tips are appreciated...

Philippe

Page redirect works

Thanks a lot Ray everything works fine
Another question, is there any way to remove the last line from the body file ?, ie Default submit:?

Sign in to reply to this post

Ray BorduinWebAssist

Yes. On the top of the email body file on lines 28-29 you will see:

$removeIncludes = array();
$removeIncludes[] = "Security";

Just add:

$removeIncludes = array();
$removeIncludes[] = "Security";
$removeIncludes[] = "Submit";

That will remove any form element that includes the word "Submit" from the results.

Sign in to reply to this post
Did this help? Tips are appreciated...

Philippe

removeIncludes[] = "Submit";

Thanks Ray it works.
For information in my contact page the word submit is written submit and not Submit, so it's case sensitive.
I had to write
$removeIncludes[] = "submit";

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...