Any PHP Coders?

New Member
Joined
Jan 15, 2003
Messages
872
Best answers
0
I am wondering if there are anyone here that knows php to code a publishing system.

Anyone know of anyone that is one?
 
Live free or die by the sword
Retired Forum Staff
✔️ HL Verified
💻 Oldtimer
Joined
Dec 1, 2001
Messages
7,416
Best answers
0
Location
North East Pennsylvania
Tim, you have exactly one post to convince me that you are not using this board to recruit a coder for a project.
 
New Member
Joined
Dec 24, 2003
Messages
93
Best answers
0
TimTheEnchantor said:
I am wondering if there are anyone here that knows php to code a publishing system.

Anyone know of anyone that is one?
a publishing what o_O ?

try to explain what you mean
 
New Member
Joined
Jan 15, 2003
Messages
872
Best answers
0
Here's my post:

It's for learning purposes so I can teach myself how to code. How is that recruiting? In no where in the post does it state that I am recruiting one to do the dirty work. I want to learn php.

If that doesn't convince you, fine. It's an off-topic thread so I assumed I could place it here since no other forum really had a 'web-design' category.
 
Live free or die by the sword
Retired Forum Staff
✔️ HL Verified
💻 Oldtimer
Joined
Dec 1, 2001
Messages
7,416
Best answers
0
Location
North East Pennsylvania
Just so you know, the vagueness of your original comment can be taken as a recruitment post . . . there is no need for you to be *****y in your reply; I left your thread open, didn't I?

Your thread remains open because that second comment, rudeness ignored, is exactly what I was looking for in terms of clarification.
 
New Member
Joined
Sep 22, 2004
Messages
513
Best answers
0
if you need a lot of help...i guess i could assist you. Pm me and we will talk
 
Lost in space
Banned
Joined
Oct 21, 2003
Messages
814
Best answers
0
When I first read this, I didn't reply because I thought you were attempting to recruit someone. >_>

Reading someone else's code doesn't teach you how to code, anyways.

[insert your favorite bookstore] -> purchase the PHP Bible 2nd Edition

Then grab a decent web server package to run on your local host (since PHP is parsed by a "daemon" before sending the resulting HTML to the client).

I recommend http://www.apachefriends.org/en/xampp-windows.html

http://www.apachefriends.org/en/xampp-windows.html said:
Apache HTTPD 2.0.52, MySQL 4.0.21, PHP 5.0.2 + 4.3.9 + PEAR + Switch, MiniPerl 5.8.3, mod_ssl 2.0.51, Openssl 0.9.7d, PHPMyAdmin 2.6.0 pl1, Webalizer 2.01-10, Mercury Mail Transport System for Win32 and NetWare Systems v4.01a, FileZilla FTP Server 0.9.3, SQLite 2.8.15, ADODB 4.52, Zend Optimizer 2.5.3. For Windows 98, 2000, XP.
You'll probably only need Apache and MySQL, but it's still the best way to go in my opinion. :)

If you're not sure on something, and it's not explained in the book clearly, head over to www.php.net and search there.

The PHP Bible and php.net are your best resources.
 
New Member
💻 Oldtimer
Joined
Dec 3, 2002
Messages
2,490
Best answers
0
I have a huge interest in this too. All the wbesites I build are plagued by two main issues: the people always want to update them by themselves, and they always want to "learn html" from me.

I always wanted to build a nice simple system where their web page would have folders and they could place numbered text files or picture files, and the php would parse them and set them up in such a way that they could just make updates by putting new material in said folders. Is that even possible?
 
Lost in space
Banned
Joined
Oct 21, 2003
Messages
814
Best answers
0
SaiyanPrideXIX said:
I have a huge interest in this too. All the wbesites I build are plagued by two main issues: the people always want to update them by themselves, and they always want to "learn html" from me.

I always wanted to build a nice simple system where their web page would have folders and they could place numbered text files or picture files, and the php would parse them and set them up in such a way that they could just make updates by putting new material in said folders. Is that even possible?
That's possible, but you'll be dealing with file streams... alot.

Most dynamic sites, even this forum, use a database to store everything, posts, member profiles, ban lists, etc.

The PHP files that are run retrieve data from the database and generate a page based on the values in the database.

You can do simple stuff with PHP file streams, such as check for the existence of a file(s), and make a page based on their content.

------------------------------------------------

Here's some basic filesystem code:

This loops through the current directory ( . ), and prints out the filename of every file in the folder (except for the current directory, the ., and the next directory up, the ..).

PHP:
<?php
if ($handle = opendir('.')) {
   while (false !== ($file = readdir($handle))) {
       if ($file != "." && $file != "..") {
           echo "$file\n";
       }
   }
   closedir($handle);
}
?>
You'd put your if(file_exists("path_to_file")) code in there, and then base your generated page on what it finds (or DOESN'T find O_O)

Disadvantage to file streams is that the code is hairy, and users can mess up file contents fairly easily.

------------------------------------------

As for databases, the most common type of database is MySQL ( www.mysql.org ).

To use it, you create and design "tables" that will be holding your data.

You can do this through SQL "queries" or through an interface like PHPMyAdmin ( http://img111.exs.cx/my.php?loc=img111&image=phpmyadmin.jpg ).

If you want to go for a page that can be updated/edited without writing any code, you'll want to brush up on your <.FORM> skills, since that is how you pass information from a page to a PHP file ( via $_GET[] or $_POST[] superglobal arrays ).

Those pages will be used to insert data into the database, and you can use the other pages to retrieve it. You'll have to learn the SQL query language, but it's not really that difficult in my opinion.

A common query would be like:

PHP:
<?php

        // try to connect to the database server and store the result
	$dbcnx = @mysql_connect('localhost', 'mysql_username', 'mysql_pass');

        // did we connect?
	if (!$dbcnx)
	{
		die("Unable to connect to database server at this time.");
	}

        // try to select the database
	if (! @mysql_select_db('database_name'))
	{
		die("Unable to locate the specified database at this time.");
	}

        // select everything (*) from the `random` table
       $query = "SELECT * FROM `random`";

        // send the query, and store into a variable whether it has legal syntax or not
	$result = @mysql_query($query);
	if (!$result)
	{
		print('Error performing query: ' . mysql_error());
	}

        // let's be fancy and count how many things we output
	$counter = 0;

        // read this as, "while there is data to get, fetch the next row in the table
        // I use mysql_fetch_object() because I prefer using -> over ' '
	while ( $row = mysql_fetch_object($result) )
	{
                // lets say the table has a TEXT field called "text"
                // display it and hop down two lines
                echo $row->text . "<.br><.br>";

                // add 1 to our counter
		$counter++;
	}

        echo "We outputted " . $counter . " rows from the database!";

?>
Databases may take a bit more work, but the result is a more flexible and fancy site, not to mention using databases is extra style points (and coding is all about style).

If you have any questions feel free to message me on AIM or MSN or whatever.

Edit:
Site was parsing my HTML tags, added . in them.
 
New Member
Joined
Jan 15, 2003
Messages
872
Best answers
0
Finally found out how, I need to take variables from the mysql database and display them in php pages.
 

Users who are viewing this thread

Top Bottom