Jump to content


First website


4 replies to this topic

#1 unlØgik

    Young Padawan

  • Members
  • Pip
  • 51 posts
  • Location:Portugal

Posted 18 July 2005 - 10:26 AM

Hi :) I just finished designing my layout on photoshop , and code it on dreamweaver. Plain and simple html.

Now i want to put some php scripts like counters, downloads script , etc.

Im a n00b @ php , all i know how to do is installing php/sql scripts, like blogs , gallery scripts , etc.

What i want to know is , how can i inset php code in .html pages? I was loking for some tuts here @ P2L , all i was able to learn is how to connect my website to a mysql database, but the code itself it apeas on the website as plain text :(

I was reading a bit and a php code is inserted like this :
<HTML>  
<HEAD>  
<TITLE>example</TITLE>  
</HEAD>  
<BODY>  
<?PHP insert your PHP code here 
?> 
</BODY> 
</HTML>

all the code , all the sql conecting is to be inserted in that spot between <?PHP and ?> , as i presume, right? so it wasnt supost to appear as simple text...?

What's step should i be doing to make sure everithing is ok?

Sory for my bad english :)

Edited by Prim3r, 18 July 2005 - 10:27 AM.


#2 Jaymz

    Retired P2L Staff

  • Members
  • PipPipPipPip
  • 4,104 posts

Posted 18 July 2005 - 11:25 AM

Rename the .html file to .php and it'll work :)

#3 unlØgik

    Young Padawan

  • Members
  • Pip
  • 51 posts
  • Location:Portugal

Posted 18 July 2005 - 11:37 AM

as simples as that? omg... :)

Thank you :)

#4 rc69

    PHP Master PD

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

Posted 18 July 2005 - 06:33 PM

Search the php coding section for "mysql" and you'll get plenty of tutorials on how to use mysql.
Also, stickies are more usefull then you think :lol:
http://www.pixel2lif...?showtopic=8980

#5 MillerTime

    Young Padawan

  • Members
  • Pip
  • 69 posts

Posted 18 July 2005 - 07:04 PM

just thought i'd add this for the future..the reason it works when you change it from .html to .php is beacause php can only be executed on a php file so you have to change it to a php file for it to work..yes it is simple as that. now you just have to figure out how to make a few php scritps :D





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users