Skip to main content
Inspiring
February 21, 2017
Answered

How do I know that my server supports PHP?

  • February 21, 2017
  • 6 replies
  • 3427 views

Hi everyone,

Very many thanks to all who have helped me so far it is very much appreciated.  I am trying to put together my own web page using Dreamweaver and have been following a number of tutorials.

I am now stuck on my contact page and in particular the php area (i think)....

I have followed a tutorial by Nancy_O from this community but I think / know I have done something wrong.  Would someone be able to look at my site and identify where I have made a boo boo please?

www.jmacphot.com

Again many thanks for taking the time to look at this for me, if I could I would get you a beer!

All the best

John

This topic has been closed for replies.
Correct answer Rob Hecker2

The way I would check on PHP availability would be to make a file, name it info.php and put in it:

<?php
phpinfo();

?>

This will not just tell you that PHP is installed, but also provides a lot of other useful information. For instance, if PHP version 7 is installed, then you need to write code for that version. Some code written for PHP5 would break on PHP7.

6 replies

Inspiring
February 23, 2017

I have chopped up the pages to the best of my ability and it appears to be working very well - thank you for making me aware of this and I can see the benefits or working this way (time saving).

http://www.jmacphot.com

I am now going to try and titivate, if any of you fine people have any suggestions they are very welcome - delete the site and start again is not an option though!

Thanks again!!

Rob Hecker2
Legend
February 23, 2017

Hi John,

It should be immediately clear to the website visitor what the point of the website is.

If the point of the website is to get freelance photography business, then you should make that clear at the top of the home page, not in small text at the bottom. State what kind of photographic services you offer. For instance, do you have a studio where you can do product photography for advertising?

But maybe your site is primarily intended to share with other photography enthusiasts. It kind of looks that way because only other photographers would have an interest in what camera and lens was used for the shots.Someone looking for a wedding photographer doesn't give a fig what camera is used.

If you are trying to get photography work, I suggest putting just two or three photos on the home page. Choose photos that tell a story and leave the viewer wanting to know what's going on.

Inspiring
February 23, 2017

Hi Rob

Many thanks for this useful advice.  As I am sure you can see I am newer than a newbie to web design.

The future aim of this site will be to promote as a small photographic business which will include my (trying) get a portfolio / Gallery for show.  I will also then need to find a way to give customers access to their images online securely.

I am changing the site daily (between my day job) to try and improve it and welcome all advice / guidance.

Again many thanks.

Regards

John

Inspiring
February 22, 2017

Lol it's getting there!

I have tried the include, but it has made the page go mental..lol

Contact

Nancy OShea
Community Expert
Community Expert
February 22, 2017

What are you putting inside your Include file?   It should be nothing more than a snippet of relevant code for the header or footer.  No doctype, no <html> tags, no scripts or CSS, etc...  Just the relevant code for that small section of your document.

Nancy

Nancy O'Shea— Product User & Community Expert
Inspiring
February 22, 2017

I have made a folder named includes, in there i have saved the contact.php.

I have then placed this within my document also named contact.php:

<?php include("includes/contact.php"); ?>

:-S

Inspiring
February 22, 2017

Hi Nancy

I have gone back through it all again and guess what..it works!! woop woop. I have even managed to send myself a test email to the webmail account I set up.

What would be the best way for me to enter that code into a page so it keeps my headers / footers so all my pages have them look?

Many thanks for your help as always.

Kind regards

John

Nancy OShea
Community Expert
Community Expert
February 22, 2017

jmacphot1975  wrote

What would be the best way for me to enter that code into a page so it keeps my headers / footers so all my pages have them look?

Use Server-side includes.  It's easy peasy with .php files.

Nancy

Nancy O'Shea— Product User & Community Expert
Nancy OShea
Community Expert
Community Expert
February 21, 2017

To use the contact form and processing script from my tutorial at  Alt-Web Design & Publishing: Responsive Contact Form with Bootstrap 3.2 and PHP (Part 1) you need 3 things:

1. a web server running PHP 5.3 or higher AND

2. the PHP mail () function AND

3. a valid contact page named with a .php extension.  Example:  contact.php

Your contact page contains validation errors.  No action value is appearing in the form.  It's improperly named with .html extension.

Showing results for http://www.jmacphot.com/contact.html - Nu Html Checker

If you care to copy & paste the code from your contact page into a web forum reply, I'll take a look at it.

Nancy

Nancy O'Shea— Product User & Community Expert
Rob Hecker2
Rob Hecker2Correct answer
Legend
February 21, 2017

The way I would check on PHP availability would be to make a file, name it info.php and put in it:

<?php
phpinfo();

?>

This will not just tell you that PHP is installed, but also provides a lot of other useful information. For instance, if PHP version 7 is installed, then you need to write code for that version. Some code written for PHP5 would break on PHP7.

Inspiring
February 21, 2017

Hi Rob

I have attached the result:

Does this mean the server i am using supports php?

Many thanks

John

Nancy OShea
Community Expert
Community Expert
February 21, 2017

Yes, you have PHP version 5.6.29.

Nancy

Nancy O'Shea— Product User & Community Expert
Legend
February 21, 2017

What are you stuck on?

At the minute you have an .html extension on the contact page - contact.html which presumably will include php coding? Well thats not going to work. To parse server side code you need the page to have a .php extension.

However that's not going to work locally unless you have a local server environment set up, so you would have to test the page remotely, assuming your host server supports php.

Does that make any sense?

So when you hit the submit button you wont see anything happen at the moment as the php code (assuming there is some at the top of the page) cannot be parsed by the browser.

Inspiring
February 21, 2017

Hi Osgood

It would appear I am getting stuck on everything     , thanks for looking at it for me.

I thought I had created a .php page with HTML and php code.

I have no no idea if my server host allows php, that I will check up on. What would be the alternative to php?

As soon as I find out I'll let you know.

Regards

John

Legend
February 21, 2017

jmacphot1975  wrote

I have no no idea if my server host allows php, that I will check up on. What would be the alternative to php?

Insert the below bit of code in a DW page and save it as hello_world.php, upload the file to your server and browser out to it. If you see 'Hello World' youre in business.

<?php

echo "Hello World";

?>