Code at the top of my website

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Post Reply
NarellanProbus
 
 
Posts: 13
Joined: Sat Feb 23, 2019 9:39 pm

Code at the top of my website

Post by NarellanProbus » Fri May 24, 2019 10:21 am

https://narellanprobus.org.au/
I have been creating a database and have just loaded the login to the index page (database not up yet) but this is what I have at the top. I use cpanel. Can other people hack into the site with this viewable?

0) { $items = file($database, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); foreach($items as $line) { list($username, $password, $email, $name, $active) = explode('|', trim($line)); if ($username == $_POST['username'] && $active != "0" && $password == $crypt_pass) { $found = true; $fullname = $name; } } } if($found == false) { header('Location: '.$error_page); exit; } else { if (session_id() == "") { session_start(); } $_SESSION['username'] = $_POST['username']; $_SESSION['fullname'] = $fullname; $_SESSION['expires_by'] = time() + $session_timeout; $_SESSION['expires_timeout'] = $session_timeout; $rememberme = isset($_POST['rememberme']) ? true : false; if ($rememberme) { setcookie('username', $_POST['username'], time() + 3600*24*30); setcookie('password', $_POST['password'], time() + 3600*24*30); } header('Location: '.$success_page); exit; } } $username = isset($_COOKIE['username']) ? $_COOKIE['username'] : ''; $password = isset($_COOKIE['password']) ? $_COOKIE['password'] : ''; ?>

Many thanks for your help, Sue

User avatar
BaconFries
 
 
Posts: 4470
Joined: Thu Aug 16, 2007 7:32 pm

Re: Code at the top of my website

Post by BaconFries » Fri May 24, 2019 10:29 am

This indicates that you have used the wrong page extension name. Please ensure that it is set to .php rather than .html or .htm Please also ensure that your host supports PHP as well.

NarellanProbus
 
 
Posts: 13
Joined: Sat Feb 23, 2019 9:39 pm

Re: Code at the top of my website

Post by NarellanProbus » Fri May 24, 2019 10:39 am

Thank you for your quick response. I have the file extension set to php and my host supports php. The document type is set at HTML 4.01 Transitional. is this correct. I have my host company looking at the problem now but thought it was worth adding this information.

User avatar
BaconFries
 
 
Posts: 4470
Joined: Thu Aug 16, 2007 7:32 pm

Re: Code at the top of my website

Post by BaconFries » Fri May 24, 2019 10:46 am

It looks fine now, but when I first viewed it wasn't set to .php. The Doctype doesn't matter in this instance, if you use a form or any script the uses PHP then the page extension must be set to .php to ensure thst it gets properly processed by your server.

NarellanProbus
 
 
Posts: 13
Joined: Sat Feb 23, 2019 9:39 pm

Re: Code at the top of my website

Post by NarellanProbus » Fri May 24, 2019 10:49 am

Thank you. It is good to know that help is there.

NarellanProbus
 
 
Posts: 13
Joined: Sat Feb 23, 2019 9:39 pm

Re: Code at the top of my website

Post by NarellanProbus » Fri May 24, 2019 12:08 pm

I have been playing with the website again since talking with you and the host company. They support php but the help desk said to change the extension back to html rather than php - I knew that was not correct. What I have found is to have the login on another page, not the index page. I could then set that to php and the code did not come up at the top. I will continue with developing the database and login and hopefully this solves my problem. Hopefully if anyone else has the same issue then that may solve their problems too. Many many thanks once again because just talking with you gave me the incentive to keep going. I am a senior but I love technology although it gives me a headache at times.

Post Reply