News:

Wieners, Brats, Franks, we've got 'em all.

Main Menu

[PHP] Basic Blog Tutorial!

Started by Joe, August 16, 2005, 10:41:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Joe

http://www.javaop.com/~joe/php/blogtut.txt

Aimed at: People who have basic PHP + intermediate HTML knoledge.
Complexity: Simple.

Shows the for statment, arrays, echo, multiple php blocks, and echoing variables.
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


rabbit

I'd make the complexity 'simple'.  Intermediate would be manipulation of files, and advanced would be MySQL interaction.

Sidoh

* Sidoh agrees with Rabbit.

That's about as simple as PHP gets.

Also, you don't need to define an index.  You can just do:


$a = array();

$a[] = "First item.";
$a[] = "Second item.";
$a[] = "Third item.";


I wouldn't use the method you're using either (if I would even consider using arrays without the combination of MySQL).  I'd use multidimensional arrays.

drka

Quote from: rabbit on August 16, 2005, 05:19:43 PM
I'd make the complexity 'simple'. Intermediate would be manipulation of files, and advanced would be MySQL interaction.
interaction with MySQL?

that's kinda simple -_-

Sidoh

Yeah, but you think everything is simple.  Yet, when you look at your depth of knowledge, it's pretty shallow.

deadly7

Quote from: Mangix on August 17, 2005, 05:51:38 AM
Quote from: rabbit on August 16, 2005, 05:19:43 PM
I'd make the complexity 'simple'. Intermediate would be manipulation of files, and advanced would be MySQL interaction.
interaction with MySQL?

that's kinda simple -_-
Ok. Go and code me an admin page that edits MySQL Database tables, adds new columns, and changes the type. Also, make sure you can add entries to the database as well.
[17:42:21.609] <Ergot> Kutsuju you're girlfrieds pussy must be a 403 error for you
[17:42:25.585] <Ergot> FORBIDDEN

on IRC playing T&T++
<iago> He is unarmed
<Hitmen> he has no arms?!

on AIM with a drunk mythix:
(00:50:05) Mythix: Deadly
(00:50:11) Mythix: I'm going to fuck that red dot out of your head.
(00:50:15) Mythix: with my nine

rabbit


deadly7

Yes, but that's not exactly EASY to make.
[17:42:21.609] <Ergot> Kutsuju you're girlfrieds pussy must be a 403 error for you
[17:42:25.585] <Ergot> FORBIDDEN

on IRC playing T&T++
<iago> He is unarmed
<Hitmen> he has no arms?!

on AIM with a drunk mythix:
(00:50:05) Mythix: Deadly
(00:50:11) Mythix: I'm going to fuck that red dot out of your head.
(00:50:15) Mythix: with my nine

rabbit


deadly7

Quote from: Mangix on August 17, 2005, 05:51:38 AM
Quote from: rabbit on August 16, 2005, 05:19:43 PM
I'd make the complexity 'simple'. Intermediate would be manipulation of files, and advanced would be MySQL interaction.
interaction with MySQL?

that's kinda simple -_-

I was talking to Mangix, rabbit..
[17:42:21.609] <Ergot> Kutsuju you're girlfrieds pussy must be a 403 error for you
[17:42:25.585] <Ergot> FORBIDDEN

on IRC playing T&T++
<iago> He is unarmed
<Hitmen> he has no arms?!

on AIM with a drunk mythix:
(00:50:05) Mythix: Deadly
(00:50:11) Mythix: I'm going to fuck that red dot out of your head.
(00:50:15) Mythix: with my nine

rabbit

Quote from: deadly7 on August 19, 2005, 02:01:18 PM
Quote from: Mangix on August 17, 2005, 05:51:38 AM
Quote from: rabbit on August 16, 2005, 05:19:43 PM
I'd make the complexity 'simple'. Intermediate would be manipulation of files, and advanced would be MySQL interaction.
interaction with MySQL?

that's kinda simple -_-

I was talking to Mangix, rabbit..
Tehn +"@Mangix", cause you were confusing.

Joe

// SQL database connection
echo("[DEBUG] Connecting to SQL database..<br />\n");
  $SQL_CONNECTION = @mysql_pconnect($CONFIG_SQL_HOSTNAME, $CONFIG_SQL_USERNAME, $CONFIG_SQL_PASSWORD);
if ($SQL_CONNECTION) {
    echo("[DEBUG] Connected to SQL database.<br />\n");
   
    // Open the database
  echo("[DEBUG] Attempting to open database $CONFIG_SQL_DATABASE.<br />\n");
$SQL_DATABASE = @mysql_select_db($CONFIG_SQL_DATABASE, $SQL_CONNECTION);
if($SQL_DATABASE) {
echo("[DEBUG] Now using &CONFIG_SQL_DATABASE.<br />\n");
} else {
echo("[ERROR] Unable to open database $CONFIG_SQL_DATABASE.<br />\n");
$SQL_ERROR = @mysql_error(); echo("[ERROR] $SQL_ERROR<br />\n");
}

} else {
$SQL_DATABASE = null;
  echo("[ERROR] Unable to connect to SQL database.<br />\n");
  $SQL_ERROR = @mysql_error(); echo("[ERROR] $SQL_ERROR<br />\n");
}


Well, its a start, deadly. =)
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


deadly7

Quote from: rabbit on August 19, 2005, 11:52:14 PM
Quote from: deadly7 on August 19, 2005, 02:01:18 PM
Quote from: Mangix on August 17, 2005, 05:51:38 AM
Quote from: rabbit on August 16, 2005, 05:19:43 PM
I'd make the complexity 'simple'. Intermediate would be manipulation of files, and advanced would be MySQL interaction.
interaction with MySQL?

that's kinda simple -_-

I was talking to Mangix, rabbit..
Tehn +"@Mangix", cause you were confusing.
I quoted Mangix for a reason. nub.
[17:42:21.609] <Ergot> Kutsuju you're girlfrieds pussy must be a 403 error for you
[17:42:25.585] <Ergot> FORBIDDEN

on IRC playing T&T++
<iago> He is unarmed
<Hitmen> he has no arms?!

on AIM with a drunk mythix:
(00:50:05) Mythix: Deadly
(00:50:11) Mythix: I'm going to fuck that red dot out of your head.
(00:50:15) Mythix: with my nine

drka

Quote from: Sidoh on August 17, 2005, 12:28:57 PM
Yeah, but you think everything is simple. Yet, when you look at your depth of knowledge, it's pretty shallow.
if you asked me how much i know PHP, i would answer "i know enough".

i dont work too much with PHP since i dont see any use for it.

oh and deadly, google up phpMyAdmin. it's really nice.

Sidoh

Quote from: Mangix on August 22, 2005, 07:45:31 PM
Quote from: Sidoh on August 17, 2005, 12:28:57 PM
Yeah, but you think everything is simple. Yet, when you look at your depth of knowledge, it's pretty shallow.
if you asked me how much i know PHP, i would answer "i know enough".

i dont work too much with PHP since i dont see any use for it.

oh and deadly, google up phpMyAdmin. it's really nice.

Quite honestly, I've found your knowledge of just about everything you seem to believe to be fluent in to be shallow.