Jump to content


PHP Out Of Database.


11 replies to this topic

#1 Hyprkookeez

    Young Padawan

  • Members
  • Pip
  • 49 posts
  • Location:Edmonton AB CA
  • Interests:Photoshop, HTML

Posted 29 September 2005 - 04:55 PM

I want to have a phpbased site system, and with it I want everything to basically be part of a database. I can't seem to figure out how to export <?php ?> stuffs to well.. PHP. it goes as a comment in browser-side.

Anyone care to help me out?

#2 MillerTime

    Young Padawan

  • Members
  • Pip
  • 69 posts

Posted 29 September 2005 - 05:23 PM

whats the extension for the file where you have php? it must be .php, not .html.php, just .php

#3 Hyprkookeez

    Young Padawan

  • Members
  • Pip
  • 49 posts
  • Location:Edmonton AB CA
  • Interests:Photoshop, HTML

Posted 29 September 2005 - 05:47 PM

I have it .php... It's just I have a plan to store the info in a database, and it won't let me echo php out of it.

#4 MillerTime

    Young Padawan

  • Members
  • Pip
  • 69 posts

Posted 29 September 2005 - 06:00 PM

make sure your host allows php and it is turned on

#5 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 29 September 2005 - 06:11 PM

http://php.net/manua...asic-syntax.php
http://php.net/manua...mysql-query.php

From what i understand, those links may help untill you give us an example of your problem.

#6 Hyprkookeez

    Young Padawan

  • Members
  • Pip
  • 49 posts
  • Location:Edmonton AB CA
  • Interests:Photoshop, HTML

Posted 29 September 2005 - 08:34 PM

Ugh!!!!!!!!
I know php!!!!

Okay.. i'm beginning to think nobody knows my problem...

I have a script in my MYSQL DATABASE and when i ECHO The script it appears as a comment on my page, instead of ACTUAL PHP...

I highlighted the important parts. :D

It has something to do with explode() or something.

Can anyone suggest something now that you might get it?

#7 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 29 September 2005 - 09:28 PM

Ok, question. By comment, do you mean that in the html source, it still has the PHP tags, or html comment tags, or does it just echo out plain text?

Either way, would the eval() function help you any?

p.s. Whether or not you know php, the way you worded things made it sound like those links would really help :D And yet again, if the above function doesn't work, a copy/paste example would REALLY help. (i.e. the source php, and end html source).

#8 HaloprO

    Requires Armed Escort

  • Members
  • PipPip
  • 310 posts
  • Gender:Male
  • Location:California, USA

Posted 30 September 2005 - 01:15 AM

He's trying to store code in a database, he wants to echo out scripts form a database

#9 MillerTime

    Young Padawan

  • Members
  • Pip
  • 69 posts

Posted 30 September 2005 - 01:13 PM

if i what i think your thinking is right..i must tell you that you cannot echo out php scripts.. They will just turned over into php..

you just need to either post your code or atleast explain a little more

#10 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 30 September 2005 - 03:20 PM

HaloprO, on Sep 29 2005, 11:15 PM, said:

He's trying to store code in a database, he wants to echo out scripts form a database
Ok... possibly try the highlight_string() function?

#11 HaloprO

    Requires Armed Escort

  • Members
  • PipPip
  • 310 posts
  • Gender:Male
  • Location:California, USA

Posted 30 September 2005 - 06:04 PM

You guys are funny, here do this
<?php
$php_code = '<?php echo "example php code, you can even assign this variable a value of soemthing from a database"; ?>';
echo eval('?>'.$php_code);
?>
Replace the value of the $php_code variable with whatever you want

#12 Hyprkookeez

    Young Padawan

  • Members
  • Pip
  • 49 posts
  • Location:Edmonton AB CA
  • Interests:Photoshop, HTML

Posted 30 September 2005 - 06:31 PM

Thank you so much! You're like a lifesaver!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users