Weird thing happening - Post ID 180718

User 34904 Photo


Registered User
41 posts

Exported a form to a web folder on my hard drive (which will ultimately be FTP'ed to hosting site) and when I fill out the form in browser and hit submit I get the strange code below. It's supposed to redirect to a (currently non-existent) Thank You page on same hosting site. Is this just happening because it's now still just sitting on my hard drive and will work correctly once it's installed on a proper host with PHP on board?

<?php

$scriptpath = substr( $_SERVER['SCRIPT_FILENAME'], 0, -4 );
$paths = explode ( DIRECTORY_SEPARATOR , $scriptpath );
$myName = end($paths);
require $scriptpath . '/fbapp/php/config.inc.php';


if( strtoupper( $_SERVER['REQUEST_METHOD'] ) == 'POST' ) {

include 'fbapp/php/formcontroller.cls.php';

$ctl = new FormController( $myPage );
$ctl->Dispatch();

} else {

if( ! isset( $_GET['confirmation'] ) ) $myPage->ReportStats( 'NotifyFormView' );
}

ob_start();
$myPage->Show();
ob_end_flush();

?>
vague new world....since 1949
www.vaguenewworld.com
User 187934 Photo


Senior Advisor
20,239 posts

You can't test the submit button on your local pc. Because of the PHP it needs to be tested on the server after upload.:)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 34904 Photo


Registered User
41 posts

Great. Kind of as I expected but it's good to get corroboration. Thanks for the quick response.
vague new world....since 1949
www.vaguenewworld.com
User 464893 Photo


Ambassador
1,611 posts

You could install Wamp (Free) that gives you a server on your computer and a mysql database option. I use it to test my php with. Without that Eric is right it needs a server to run.

Only thing it uses Local host and the addresses will have to suit the folders on your computer where you have your website ie C:\wamp\www\yoursite\ (backslashes have to change to forward slashes when uploaded I have found).

I have not set it up or tried it but apparently you can also send emails and go live and host your own site.
Have your computer on 24/7 ???
My 2 cents
The Guy from OZ



Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.