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.
Buying anything on Amazon? Please use the Geekzone Amazon aff link.




438 posts

Ultimate Geek


Topic # 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
468 posts

Ultimate Geek
+1 received by user: 85


  Reply # 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.





468 posts

Ultimate Geek
+1 received by user: 85


  Reply # 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.





574 posts

Ultimate Geek
+1 received by user: 122


  Reply # 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

468 posts

Ultimate Geek
+1 received by user: 85


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

*Expression Web not Expression Engine





574 posts

Ultimate Geek
+1 received by user: 122


  Reply # 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



438 posts

Ultimate Geek


  Reply # 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

574 posts

Ultimate Geek
+1 received by user: 122


  Reply # 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

468 posts

Ultimate Geek
+1 received by user: 85


  Reply # 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?





22 posts

Geek


  Reply # 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? 

574 posts

Ultimate Geek
+1 received by user: 122


  Reply # 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

468 posts

Ultimate Geek
+1 received by user: 85


  Reply # 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 »
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:





Trending now »

Hot discussions in our forums right now:

Am I going down? App for the fearful of flying.
Created by networkn, last reply by Sideface on 29-Jan-2015 23:07 (47 replies)
Pages... 2 3 4


Police Speed Campaign - Summer 2014/2015
Created by nzkiwiman, last reply by scuwp on 31-Jan-2015 22:18 (179 replies)
Pages... 10 11 12


Post your Boat
Created by TimA, last reply by Beccara on 31-Jan-2015 20:40 (38 replies)
Pages... 2 3


Which canon flash?
Created by esawers, last reply by timmmay on 30-Jan-2015 16:15 (19 replies)
Pages... 2


Bad lower back.
Created by TimA, last reply by jimbob79 on 30-Jan-2015 16:01 (77 replies)
Pages... 4 5 6


New to VDSL and wondering if I can change where the modem connects in the house
Created by Valcor, last reply by quickymart on 29-Jan-2015 20:59 (17 replies)
Pages... 2


AdBlockers on Geekzone
Created by freitasm, last reply by wally22 on 29-Jan-2015 09:55 (69 replies)
Pages... 3 4 5


Help recognize big black spider nope
Created by solival, last reply by heylinb4nz on 30-Jan-2015 13:34 (16 replies)
Pages... 2



Geekzone Live »

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

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.