PDA

View Full Version : 'Include' function (PHP etc)


Rob_Che
05-07-2008, 11:53 AM
Hello all... So... I use a command like (I mean 'like' - I don't do PHP):

<?php
include "mypage.php";
?>

This includes the PHP file onto my page.

I have also experimented with making a dummy PHP file with just text in it and this
command will import this text into the div.

The reason I'm messing with this is that I'm hoping that I could hyperlink a PHP file
into a doc so that a customer could update their own news page... Am I missing something ?
Seems quite logical in my illogical mind.

GO!

m1a2x3x7
05-07-2008, 06:01 PM
it should be:

<?php
include_once('mypage.php');
?>

Rob_Che
05-07-2008, 07:18 PM
Sorry... it was just using that code as an example (but it is better to be right!)... Cheers tho !

Can I include any other types of file in this way ?

ie; if I had a simple skelatal page, could I add an "include" function for say an excel spreadsheet etc ?

domedia
05-07-2008, 08:02 PM
Browser reads HTML, CSS and Javascript, not microsoft spreadsheet code :)

The include function is not an 'import/convert function'. It simply grabs the content of that file.

Rob_Che
05-07-2008, 10:22 PM
I know I'm bein gvery literal but I'm just thinking out loud...

So if my customer had a load of text and saved it with a PHP file extension and saved it remotely.
Surely, I could just hyperlink to it and control throught the css boundaries set within the page.. no ?

davidj
05-07-2008, 10:54 PM
better to setup a CMS or build a feature for your client to fill in a form and the data is stored in a db for you to call to the page

Rob_Che
05-07-2008, 11:32 PM
Yeah, I know that's the correct process...

I'm just playing... would it work though ?

I'll try it and report back...

domedia
05-08-2008, 01:04 AM
yes it would. But unless you had some paragraph tags in there, it's just all going to be one string of text

Rob_Che
05-08-2008, 08:15 AM
Cheers Domedia... That was one thing that worried me...

Is there a way to bring in tablature data do you know ?

davidj
05-08-2008, 10:43 AM
your going to have to bite the bullet sometime.

do it properly and write something

it wont take long to do with a little help from the guys

domedia
05-08-2008, 02:40 PM
Is there a way to bring in tablature data do you know ? Yes, but it has to be be stored either in a DB or XML file to be retrieved.

Rob_Che
05-08-2008, 02:57 PM
Ok then... I KNOW I'm gonna have to do it it's just difficult at the moment to get the amount of time I need set aside to get through the tuts...

It's so foreign to me that I daren't stop and start - I think I need to put some time aside.


I downloaded Wamp previously... is there any software in the tutorials that I have to buy or is all found freeware ?

Cheers
Rob

edbr
05-09-2008, 01:38 AM
its all good, only cost you the odd laptop thrown out the window (joke honest)

davidj
05-09-2008, 06:59 AM
install wamp and your ready to go

Rob_Che
05-09-2008, 11:27 AM
oh, ok... there was EMS MYSQL LITE also... what tutorial was I following then ?

What's the best tut to start with ? has that page changed, looks different ?

davidj
05-09-2008, 07:50 PM
follow my signature

Rob_Che
05-09-2008, 08:01 PM
So is THIS (http://www.download.com/EMS-SQL-Manager-2007-Lite-for-MySQL/3000-10255_4-10439256.html?tag=lst-1&cdlPid=10786835)the software for the mysql stuff ?

Rob_Che
05-09-2008, 10:49 PM
Sorted it... I'm gonna get this !