Page 1 of 1

Unknown code on top of page preview

Posted: Sat Aug 15, 2026 5:41 am
by Centaur11
I have just bought this software, and am reasonably impressed with it. I have completed my first website, but when I preview it, I get a lot of, what i assume is, error code on top of the preview. I cant make heads or tails out of it.

I used a template provided by WYSIWYG, and removed or changed it quite a bit.


I need help. I have done this website for a friend, and want to get this done so I can send it off.

Below is the error code.

"; throw new Exception($error); } $message .= $eol; $message .= "IP Address : "; $message .= $_SERVER['REMOTE_ADDR']; $message .= $eol; foreach ($_POST as $key => $value) { if (!in_array(strtolower($key), $internalfields)) { if (is_array($value)) { $message .= ucwords(str_replace("_", " ", $key)) . " : " . implode(",", $value) . $eol; } else { $message .= ucwords(str_replace("_", " ", $key)) . " : " . $value . $eol; } } } $body = 'This is a multi-part message in MIME format.'.$eol.$eol; $body .= '--'.$boundary.$eol; $body .= 'Content-Type: text/plain; charset=UTF-8'.$eol; $body .= 'Content-Transfer-Encoding: 8bit'.$eol; $body .= $eol.stripslashes($message).$eol; if (!empty($_FILES)) { foreach ($_FILES as $key => $value) { if ($_FILES[$key]['error'] == 0) { $body .= '--'.$boundary.$eol; $body .= 'Content-Type: '.$_FILES[$key]['type'].'; name='.$_FILES[$key]['name'].$eol; $body .= 'Content-Transfer-Encoding: base64'.$eol; $body .= 'Content-Disposition: attachment; filename='.$_FILES[$key]['name'].$eol; $body .= $eol.chunk_split(base64_encode(file_get_contents($_FILES[$key]['tmp_name']))).$eol; } } } $body .= '--'.$boundary.'--'.$eol; if ($mailto != '') { mail($mailto, $subject, $body, $header); } header('Location: '.$success_url); } catch (Exception $e) { $errorcode = file_get_contents($error_url); $replace = "##error##"; $errorcode = str_replace($replace, $e->getMessage(), $errorcode); echo $errorcode; } exit; } ?>

I think it has to do with the contact form I have done, but I cannot understand where I went wrong, or how to rectify it.

ANY help would be greatly appreciated.

Re: Unknown code on top of page preview

Posted: Sat Aug 15, 2026 5:58 am
by Centaur11
I think I have worked it out. It seems I had used php for the form, but now that I have taken that back to html, all seems good, but now I dont know if my contact form will work correctly. I have tried it in preview form, but it brings up my own email client (of course), but no subject line or form data is in the body of email, and I cant seem to get that info into the email from the form.

Is there a way i can test this contact form to make sure it all works.

Re: Unknown code on top of page preview

Posted: Sat Aug 15, 2026 6:01 am
by Pablo
This is the PHP script of the form. If the page uses PHP then you will need to set the page extension to PHP.

See also the FAQ:
https://forum.wysiwygwebbuilder.com/vie ... hp?t=32967

Re: Unknown code on top of page preview

Posted: Sat Aug 15, 2026 6:51 am
by Centaur11
I tried setting the pages to php, but then the menu on the main page did not work. It would not find the index page, but when I changed back to html, all the menu items worked.

Is there a way to use php for the contact form, change extenson for the pages to php, and still have the page menu still work?

Oh, and not get the above code to come back.

Re: Unknown code on top of page preview

Posted: Sat Aug 15, 2026 6:59 am
by AliGW
Which menus are you using?

Re: Unknown code on top of page preview

Posted: Sat Aug 15, 2026 7:08 am
by Pablo
If you change the page extension then you will have to republish all pages that are referring to that page, otherwise they still have the old link.

Re: Unknown code on top of page preview

Posted: Sat Aug 15, 2026 7:43 am
by Centaur11
I have changed back to php, and republished the page items in the menue setp, but now when I go to preview, it wont open, just asks what to open with. So i set default programme for .php to Chrome, now it just shows code, and not the web page for preview.

This webpage design and webpage construction is full of pit falls.

Re: Unknown code on top of page preview

Posted: Sat Aug 15, 2026 7:44 am
by Centaur11
AliGW wrote: Sat Aug 15, 2026 6:59 am Which menus are you using?
I am using panel meus.

Re: Unknown code on top of page preview

Posted: Sat Aug 15, 2026 8:09 am
by BaconFries
Is there a way i can test this contact form to make sure it all works.
You cannot "Test" "Preview" php locally it must be uploaded to your host/server for it to work due to the php needs to be processed there.
It will also require that your host supports php if not then then it can't run.
But you can disable PHP in Tools -> Options -> Publish -> Remove PHP code in preview

Re: Unknown code on top of page preview

Posted: Sat Aug 15, 2026 8:19 am
by Centaur11
BaconFries wrote: Sat Aug 15, 2026 8:09 am
Is there a way i can test this contact form to make sure it all works.
You cannot "Test" "Preview" php locally it must be uploaded to your host/server for it to work due to the php needs to be processed there.
It will also require that your host supports php if not then then it can't run.
But you can disable PHP in Tools -> Options -> Publish -> Remove PHP code in preview
Thanks for the heads up.

Looks like I need to watch more "how to" youtube videos.

Re: Unknown code on top of page preview

Posted: Sat Aug 15, 2026 8:27 am
by BaconFries
If you do wish to test locally you can install the likes of xampp on your PC/Laptop this will allow testing. Note that the installation of xampp is outwith the support of the forum and it not related to the softwares use in anyway.