|
-
Dec 12th, 2002, 02:59 AM
#1
Thread Starter
Hyperactive Member
Taking PHP info from a file! Like a Template.
Does anyone know how I would go about doing this ?? could I just something like <link... > statement? or does PHP code need something more sophisticated?
how also would i split up a vaible, so everytime it gets to a ; it writes what its written to an array, then carrys on readin until it gets to another value, e.g.
value of string: a;b;c;d;e
becomes
$pie[0] = a
$pie[1] = b
$pie[2] = c
$pie[3] = d
$pie[4] = e
thanks
Last edited by JafferAB; Dec 12th, 2002 at 04:59 AM.
Power to 2000 Electronic Donkeys!
www.edonkey2000.com
I hate case sensitivity... all you get down the M1 is "are we there yet" and "ouch, watch the bumps".
-
Dec 12th, 2002, 09:02 AM
#2
Conquistador
-
Dec 12th, 2002, 11:36 AM
#3
Thread Starter
Hyperactive Member
cool thanks took me a little bit fo a while to work out what it meant, but i got it in the end!
Power to 2000 Electronic Donkeys!
www.edonkey2000.com
I hate case sensitivity... all you get down the M1 is "are we there yet" and "ouch, watch the bumps".
-
Dec 12th, 2002, 01:57 PM
#4
Frenzied Member
could have also used explode()
$pie = explode(";", $string);
if you didn't want to use preg_split
Does anyone know how I would go about doing this ?? could I just something like <link... > statement? or does PHP code need something more sophisticated?
not sure what you mean by this, elaborate ?
-
Dec 12th, 2002, 04:10 PM
#5
Thread Starter
Hyperactive Member
elaboration : e.g. to gain the information from a CSS file, you may use this...
Code:
<link rel="stylesheet" type="text/css" href="default.css">
this will use the code from default.css and use it in the webpage..
What I want to do, for example, is add this code, which is in pie.php for example...
Code:
<?PHP
print "pie is good, pie is life";
?>
so that where the link to pie.php (other extensions, or whatever) prints in that space, "pie is good, pie is life".
Does this help ?
P.S. Tanks fo rthe previous help, i managed to get it all working sweet as a chestnut (a bit rough round the edges, but it ltimatele works )
Power to 2000 Electronic Donkeys!
www.edonkey2000.com
I hate case sensitivity... all you get down the M1 is "are we there yet" and "ouch, watch the bumps".
-
Dec 12th, 2002, 04:36 PM
#6
Frenzied Member
yes you can use the <link... tag just like regular html. but you have to do it in the same spot as well, in the header tag.
-
Dec 12th, 2002, 06:05 PM
#7
Thread Starter
Hyperactive Member
ah right, so its gotta be set in a variable :-/ hmm, that could be a bit usefull i suppose!
cheers
Power to 2000 Electronic Donkeys!
www.edonkey2000.com
I hate case sensitivity... all you get down the M1 is "are we there yet" and "ouch, watch the bumps".
-
Dec 12th, 2002, 06:40 PM
#8
Frenzied Member
no it can't be set in a variable. I meant like regular html in between the head tags.
<html>
<head>
<link ..... >
</head>
<body>
<?php
php here
?>
</body>
</html>
that is the same as the header in php.
-
Dec 13th, 2002, 02:41 AM
#9
Thread Starter
Hyperactive Member
hmmmmmm, ok, thanks
Power to 2000 Electronic Donkeys!
www.edonkey2000.com
I hate case sensitivity... all you get down the M1 is "are we there yet" and "ouch, watch the bumps".
-
Jan 9th, 2003, 02:56 AM
#10
Hyperactive Member
Originally posted by phpman
no it can't be set in a variable. I meant like regular html in between the head tags.
<html>
<head>
<link ..... >
</head>
<body>
<?php
php here
?>
</body>
</html>
that is the same as the header in php.
Use include('filename.dat');
or require('filename.dat');
It outputs the contents straight to the web browser it does not parse it.
-
Jan 9th, 2003, 11:45 AM
#11
Frenzied Member
-
Jan 10th, 2003, 01:29 PM
#12
Hyperactive Member
Originally posted by phpman
umm yes it does.
I meant, unless the filename is .php (or whatever the quivilent is) it isn't.
But suppose depends on server setup.
-
Jan 15th, 2003, 07:52 AM
#13
New Member
Try using virtual($filename);
...
I dunno I'm clutchin at straws here.
-
Jan 15th, 2003, 08:07 AM
#14
I meant, unless the filename is .php (or whatever the quivilent is) it isn't.
But suppose depends on server setup.
It still does.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|