Jump to content
xisto Community
Sign in to follow this  
MusicOnly

How To Incorporate A Php Script To My Website php beginner needs help

Recommended Posts

Well i dont know exactly how to say this but i ll try. So last few months i ve been discovering web design, dreamweaver, photoshop. I learned how to create layout and how to preapare it in dreamweaver but now i am stuck with php. I dont know how to put script in desired cell an lots of other stuff. yeah i am stupid, but i am who i am. all those tutorials are not helping me because they dont tell you how to install script where i want.
i am going to explode. i tried to find finished script on hotscripts.com but i cant/dont_know which one will suite my needs. my layout is here.

You see, i need shoutbox script, search script like one here where i can search by song or band names, script which will show the most downloaded songs ( top 5 songs on my layout), and script which will show last 5 updated items.. and so on.. list is quite big, because i have big plans for my site and php is my only problem wright now.

My main question would be how to install damn script where i want?
Second question would be can someone help me?


Notice from BuffaloHELP:
Topic title is very important. Please make it very specific. Modified.

Edited by BuffaloHELP (see edit history)

Share this post


Link to post
Share on other sites

Once you insert a PHP script into your current page, you need to rename or save as whateverfilename.php otherwise your PHP script will not work.

 

If, let's say, you want to insert a PHP script to your finished HTML page within a table setting, a simple way to start would be:

 

<table>
<tr>
<td>

<?PHP 
{insert the complete php script here}
{and close it with}
?>

</td>
</tr>
</table>

 

You'll note that <?PHP is the command to start the PHP script and ?> tells it to stop running the PHP script. For more information on how to use PHP scripts, visit http://php.net/ or http://www.w3schools.com/ for more samples.

 

This above sample is the easiest way to start using PHP scripts for your skill level. As you graduately become more comfortable using PHP code structure, you can then design the whole webpage using only PHP commands, rather than half HTML and half PHP. But the fundamentals of PHP codes come from basic HTML commands.

Share this post


Link to post
Share on other sites

thanks Buffalo. It helped me a lot. And sorry for posting topic in wrong section.

Share this post


Link to post
Share on other sites

I always find PHP script hard to work with, but with the right resources it can be done very easily.

Share this post


Link to post
Share on other sites

There is another option for inserting PHP scripts into a page, especially if you are going to be using the same script on a lot of pages. If you put the script in it's own file (surrounded by the <?PHP and ?>) and give it a logical name, such as shoutbox.php, you can then include that file in any page you want. It also means that if you edit the script you automatically edit it for every page rather than having to go through and change it hundreds of times. To include a file you need 1 line:

Rest of your HTML here...<?PHP include('filename.php'); ?>Some more HTML here...

Share this post


Link to post
Share on other sites

True that will work but with most scripts, like rvalkass said uses the include function. Antoher way you could do it is to make a pure php file and use variables

for example:

<?php$watever="your code here";?>
then in your main file:

 

<?PHP include('filename.php'); ?>$watever
I think that is right but ill have to check u on it :) Edited by Gem (see edit history)

Share this post


Link to post
Share on other sites

True that will work but with most scripts, like rvalkass said uses the include function. Antoher way you could do it is to make a pure php file and use variables

for example:

<?php$watever="your code here";?>
then in your main file:

 

<?PHP include('filename.php'); ?>$watever
I think that is right but ill have to check u on it :)

 


yes, the code for using PHP include is

 

<?php include("FILE NAME.html"); ?>

and in their case, they would be putting a PHP script into the file so they would need it to be .php :P

 

 

i wrote a tutorial on how to use the PHP includes you can find it

 

http://forums.xisto.com/topic/33636-how-to-make-a-simple-php-site-making-one-file-show-up-on-all-pages-using-php/ there :P if you need further help with it.. if you evern plan on using it you can look there or PM me as well..

Share this post


Link to post
Share on other sites

Give yourself lots of space when you are typing/copying your info on to your script.LotsOfSpacesDoesntMatterAnd remember what buffalo said, remember to rename it .PHP , all of your html stuff will still work but without it your php stuff wont.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.