p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: Newbie to PHP...... Please help!


Message #1 by "maranda d." <amirs_fetish@y...> on Tue, 18 Feb 2003 04:31:06
I have a fanfiction archive with literally hundreds of pages. I heard 
that php would be better to use on a site this large instead of plain 
html, at least to link the pages.  However, I've read every online 
tutorial I can get my hands on and still don't understand anything about 
php.  Is there no place that just has php codes and what they do, like 
html?  Like, if I want this then I do this, etc.  I can't even find a 
place to tell me a simple link code. I just want to link to another page 
and I can't figure it out!  Can anyone give any suggestions? Please?!?
Message #2 by Krister <krister@m...> on Tue, 18 Feb 2003 11:06:36 +0100
On 18/02/03 4:31, "maranda d." <amirs_fetish@y...> wrote:

> I have a fanfiction archive with literally hundreds of pages. I heard
> that php would be better to use on a site this large instead of plain
> html, at least to link the pages.  However, I've read every online
> tutorial I can get my hands on and still don't understand anything about
> php.  Is there no place that just has php codes and what they do, like
> html?  Like, if I want this then I do this, etc.  I can't even find a
> place to tell me a simple link code. I just want to link to another page
> and I can't figure it out!  Can anyone give any suggestions? Please?!?
Hi
I cannot see how PHP could be better for linking, but if you need to use
database or/and search-function you wil need some serverside scripting.
You cannot use PHP or any serverside scripting just like that, it must be
installed on your computer and at your webhost.
One place to start is here: http://www.php.net/

Message #3 by "Nikolai Devereaux" <yomama@u...> on Tue, 18 Feb 2003 10:44:42 -0800
> I have a fanfiction archive with literally hundreds of pages. I heard
> that php would be better to use on a site this large instead of plain
> html, at least to link the pages.  However, I've read every online
> tutorial I can get my hands on and still don't understand anything about
> php.  Is there no place that just has php codes and what they do, like
> html?  Like, if I want this then I do this, etc.  I can't even find a
> place to tell me a simple link code. I just want to link to another page
> and I can't figure it out!  Can anyone give any suggestions? Please?!?


I think you're confusing what PHP does.  There are no "codes" in PHP to create
HTML links or anything like that.  PHP is a programming language.  It's most
common use is as a web scripting language.

When a user requests a page from a web server, generally, all the server does
is find the file requested, and return it's contents to the user.

PHP, however, plays a middle man in the scheme.  When a user requests a PHP
page from the webserver, the server finds the PHP page and says "Run yourself,
and I'll return your output to the user."


PHP doesn't by itself generate HTML.  It's your job as a PHP developer to
write the code that generates the HTML you want.

For example:

<?php

$greeting = "Hello, world.";

echo "<html>\n<head>\n  <title>My first PHP page</title>\n</head>\n";
echo "<body>{$greeting}</body>\n";
echo "</html>\n";

?>


There are lots of tutorials out there.  If you can't find anything on a
website, then you're not looking correctly; they shouldn't be difficult to
find.  Also, there are a LOT of good intro books that assume no previous
programming knowledge.

For example, look at the PHP language homepage tutorial:
  http://www.php.net/tutorial

And look at the long list of PHP-related websites in their links section:
  http://www.php.net/links


Take care,

Nik


  Return to Index