Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.




439 posts

Ultimate Geek


# 140831 21-Feb-2014 12:25
Send private message

Hi Geekzone and thank you for reading this post,

I have develped my first website with multiple pages and many of the pages have php content embed in them.

I design and build the site using expression web 4 and during the develpment i was able to test the pages loading the php embed data in them just by adding server host number to the hyperlink
it seemed like the page went through the development server then post it the data.


Now i upload the site to my live server and my php content is not loading so i was wondering if anyone could helpme, i spent hours in Google but most people use wordpress and my host does not have any user interface setup just do everything through dreamweaver or expression web.


my local host url looks like 

localhost:25888/folder/webpage and it loads
my pages in live server are trying to connect to my localhost address but i dont know what to put as new address link?

please help me out I did google it and could no find a way to sort it out,



Kind regards,


Andrew

Create new topic
563 posts

Ultimate Geek
+1 received by user: 89


  # 991758 21-Feb-2014 12:31
Send private message

Open up Notepad.

Enter the bold:

<?php
phpinfo();
?>


Save as info.php

Upload that to your web server and navigate to it to check PHP is working correctly.





563 posts

Ultimate Geek
+1 received by user: 89


  # 991763 21-Feb-2014 12:36
Send private message

Sorry, I was going to mention in your previous thread to maybe avoid Expression Engine and the likes as it sounds like it has a built in web server / does a lot of stuff 'automagically' and may give you a false / confusing idea about how your app will run on a real server environment etc if you're new to PHP.

I would recommend starting with XAMPP for your local server environment and doing your coding in something simple like Notepad++, then progress to something like Netbeans.





 
 
 
 


597 posts

Ultimate Geek
+1 received by user: 132


  # 991842 21-Feb-2014 14:45
Send private message

Expression engine is fine to use but you have to learn how to set up php. It sounds like you maybe using short tags and the production server doesn't have short tags turned on.




Regards
Stefan Andres Charsley

563 posts

Ultimate Geek
+1 received by user: 89


  # 991844 21-Feb-2014 14:49
Send private message

*Expression Web not Expression Engine





597 posts

Ultimate Geek
+1 received by user: 132


  # 991847 21-Feb-2014 14:53
Send private message

I've used expression web and its ok but its too much for designers and not for coders, so I used web matrix.




Regards
Stefan Andres Charsley



439 posts

Ultimate Geek


  # 991875 21-Feb-2014 16:07
Send private message

thank you all for your replies, yes i used expression web because it seemed quit user friendly and plenty of tutorials in youtube.

what i did is 

1- created a Master page for all templates to look same
2-index page and i put buttons with links to the content pages 30 pages in fact
3- each content page i saved it as PHP as it would not let me add PHP code into HTML without changing file extension.
4- I placed a <div=id....named content etc.  <div> i made it in the master page and made it the only part of the template that can be edited.
5- in every content PHP page i placed the PHP code inside the <div> named content and wallah when i test it online it pulls data perfectly into the page. {even thought is running through localhost still pulling data from online database.
6- upload it site with filezilla via ftp and site load index.htm perfectly but content pages load without any content like if php was ignored.


sorry i write too much stuff but thanks again for you replies I will play around with it again,


Andrew

597 posts

Ultimate Geek
+1 received by user: 132


  # 991876 21-Feb-2014 16:12
Send private message

GamerOC: thank you all for your replies, yes i used expression web because it seemed quit user friendly and plenty of tutorials in youtube.

what i did is 

1- created a Master page for all templates to look same
2-index page and i put buttons with links to the content pages 30 pages in fact
3- each content page i saved it as PHP as it would not let me add PHP code into HTML without changing file extension.
4- I placed a <div=id....named content etc.  <div> i made it in the master page and made it the only part of the template that can be edited.
5- in every content PHP page i placed the PHP code inside the <div> named content and wallah when i test it online it pulls data perfectly into the page. {even thought is running through localhost still pulling data from online database.
6- upload it site with filezilla via ftp and site load index.htm perfectly but content pages load without any content like if php was ignored.


sorry i write too much stuff but thanks again for you replies I will play around with it again,


Andrew


This may sound like a dumb question but a lot of people who don't know about servers seem to make this mistake:

Is php actually installed on the production server?
Does the phpinfo file like described above work?




Regards
Stefan Andres Charsley

 
 
 
 


563 posts

Ultimate Geek
+1 received by user: 89


  # 991878 21-Feb-2014 16:15
Send private message

And perhaps are you able to post a copy of one of your files so we can see how you've got it setup?





28 posts

Geek
+1 received by user: 2


  # 991879 21-Feb-2014 16:18
Send private message

My guess is you are using "absolute" URLS instead of "relative" ones. 

An example of an absolute path is <img src="http://localhost/mypic.jpg">

An example of a relative path is <img src="/mypic.jpg">

There maybe a setting in your web development suite for setting this.. alternatively there might even be an export to bla site function. You could try those out. 

And another question - is there a database for your website? 

597 posts

Ultimate Geek
+1 received by user: 132


  # 991880 21-Feb-2014 16:21
Send private message

Getsited: My guess is you are using "absolute" URLS instead of "relative" ones. 

An example of an absolute path is <img src="http://localhost/mypic.jpg">

An example of a relative path is <img src="/mypic.jpg">

There maybe a setting in your web development suite for setting this.. alternatively there might even be an export to bla site function. You could try those out. 

And another question - is there a database for your website? 


One step at a time, currently we're trying to see if he's got php successfully set up




Regards
Stefan Andres Charsley

563 posts

Ultimate Geek
+1 received by user: 89


  # 991883 21-Feb-2014 16:29
Send private message

GamerOC: thank you all for your replies, yes i used expression web because it seemed quit user friendly and plenty of tutorials in youtube.

what i did is 

1- created a Master page for all templates to look same
2-index page and i put buttons with links to the content pages 30 pages in fact
3- each content page i saved it as PHP as it would not let me add PHP code into HTML without changing file extension.
4- I placed a <div=id....named content etc.  <div> i made it in the master page and made it the only part of the template that can be edited.
5- in every content PHP page i placed the PHP code inside the <div> named content and wallah when i test it online it pulls data perfectly into the page. {even thought is running through localhost still pulling data from online database.
6- upload it site with filezilla via ftp and site load index.htm perfectly but content pages load without any content like if php was ignored.


sorry i write too much stuff but thanks again for you replies I will play around with it again,


Andrew


Remember PHP will only execute from within .php files.

*unless you have a non-standard server setup which you don't..





Create new topic



Twitter and LinkedIn »



Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

New Zealand government unveils new digital service to make business easier
Posted 16-Jul-2019 17:35


Scientists unveil image of quantum entanglement
Posted 13-Jul-2019 06:00


Hackers to be challenged at University of Waikato
Posted 12-Jul-2019 21:34


OPPO Reno Z now available in New Zealand
Posted 12-Jul-2019 21:28


Sony introduces WF-1000XM3 wireless headphones with noise cancellation
Posted 8-Jul-2019 16:56


Xero announces new smarter tools, push into the North American market
Posted 19-Jun-2019 17:20


New report by Unisys shows New Zealanders want action by social platform companies and police to monitor social media sites
Posted 19-Jun-2019 17:09


ASB adds Google Pay option to contactless payments
Posted 19-Jun-2019 17:05


New Zealand PC Market declines on the back of high channel inventory, IDC reports
Posted 18-Jun-2019 17:35


Air New Zealand uses drones to inspect aircraft
Posted 17-Jun-2019 15:39


TCL Electronics launches its first-ever 8K TV
Posted 17-Jun-2019 15:18


E-scooter share scheme launches in Wellington
Posted 17-Jun-2019 12:34


Anyone can broadcast with Kordia Pop Up TV
Posted 13-Jun-2019 10:51


Volvo and Uber present production vehicle ready for self-driving
Posted 13-Jun-2019 10:47


100,000 customers connected to fibre broadband network through Enable
Posted 13-Jun-2019 10:35



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.


Support Geekzone »

Our community of supporters help make Geekzone possible. Click the button below to join them.

Support Geezone on PressPatron



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.