Author Topic: [PHP] Basic Blog Tutorial!  (Read 13125 times)

0 Members and 2 Guests are viewing this topic.

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
[PHP] Basic Blog Tutorial!
« on: August 16, 2005, 10:41:31 am »
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.
« Last Edit: August 17, 2005, 11:17:30 am by Jojo the Jester »
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: [PHP] Basic Blog Tutorial!
« Reply #1 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.

Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: [PHP] Basic Blog Tutorial!
« Reply #2 on: August 16, 2005, 05:51:14 pm »
* 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:

Code: [Select]
$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.

Offline drka

  • ffdshow > in_mp3.dll
  • Full Member
  • ***
  • Posts: 330
    • View Profile
Re: [PHP] Basic Blog Tutorial!
« Reply #3 on: August 17, 2005, 05:51:38 am »
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 -_-

Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: [PHP] Basic Blog Tutorial!
« Reply #4 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.

Offline deadly7

  • 42
  • Moderator
  • Hero Member
  • *****
  • Posts: 6496
    • View Profile
Re: [PHP] Basic Blog Tutorial!
« Reply #5 on: August 17, 2005, 01:53:20 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

Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: [PHP] Basic Blog Tutorial!
« Reply #6 on: August 17, 2005, 05:35:59 pm »
Done.  Sorry if I spoiled it :\

Offline deadly7

  • 42
  • Moderator
  • Hero Member
  • *****
  • Posts: 6496
    • View Profile
Re: [PHP] Basic Blog Tutorial!
« Reply #7 on: August 19, 2005, 12:32:45 pm »
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

Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: [PHP] Basic Blog Tutorial!
« Reply #8 on: August 19, 2005, 01:39:08 pm »
But I never said it was.

Offline deadly7

  • 42
  • Moderator
  • Hero Member
  • *****
  • Posts: 6496
    • View Profile
Re: [PHP] Basic Blog Tutorial!
« Reply #9 on: August 19, 2005, 02:01:18 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

Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: [PHP] Basic Blog Tutorial!
« Reply #10 on: August 19, 2005, 11:52:14 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.

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: [PHP] Basic Blog Tutorial!
« Reply #11 on: August 20, 2005, 01:18:31 am »
Code: [Select]
// 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. =)
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline deadly7

  • 42
  • Moderator
  • Hero Member
  • *****
  • Posts: 6496
    • View Profile
Re: [PHP] Basic Blog Tutorial!
« Reply #12 on: August 20, 2005, 12:37:38 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

Offline drka

  • ffdshow > in_mp3.dll
  • Full Member
  • ***
  • Posts: 330
    • View Profile
Re: [PHP] Basic Blog Tutorial!
« Reply #13 on: August 22, 2005, 07:45:31 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.

Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: [PHP] Basic Blog Tutorial!
« Reply #14 on: August 22, 2005, 07:57:58 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.