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

0 Members and 4 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.

Offline Quik

  • Webmaster Guy
  • x86
  • Hero Member
  • *****
  • Posts: 3262
  • \x51 \x75 \x69 \x6B \x5B \x78 \x38 \x36 \x5D
    • View Profile
Re: [PHP] Basic Blog Tutorial!
« Reply #15 on: August 22, 2005, 08:03:03 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.

Enough for what? I highly doubt you know "enough" of anything, including English.
Quote
[20:21:13] xar: i was just thinking about the time iago came over here and we made this huge bomb and light up the sky for 6 min
[20:21:15] xar: that was funny

Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: [PHP] Basic Blog Tutorial!
« Reply #16 on: August 22, 2005, 11:02:11 pm »
* Sidoh sides with quik.

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: [PHP] Basic Blog Tutorial!
« Reply #17 on: August 22, 2005, 11:30:17 pm »
* Joe[x86] sides with the one with the sexy avatar. Wanna hook up next weekend?
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: [PHP] Basic Blog Tutorial!
« Reply #18 on: August 23, 2005, 12:02:52 am »
I've always had a fetish for the letter "X," thus I love Mangix's avatar.

</sarcasm>

Offline Blaze

  • x86
  • Hero Member
  • *****
  • Posts: 7136
  • Canadian
    • View Profile
    • Maide
Re: [PHP] Basic Blog Tutorial!
« Reply #19 on: August 23, 2005, 02:39:07 am »
<?php

echo " 'and all shall fall, was they run into the wall' ";

?>


I know php, look at me!
And like a fool I believed myself, and thought I was somebody else...

Offline drka

  • ffdshow > in_mp3.dll
  • Full Member
  • ***
  • Posts: 330
    • View Profile
Re: [PHP] Basic Blog Tutorial!
« Reply #20 on: August 23, 2005, 09:00:20 am »
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.

Enough for what? I highly doubt you know "enough" of anything, including English.

if i didnt know english, then i wouldnt be able to write, speak, or understand it.

@sidoh:get avant browser if you dont have it :P

Offline deadly7

  • 42
  • Moderator
  • Hero Member
  • *****
  • Posts: 6496
    • View Profile
Re: [PHP] Basic Blog Tutorial!
« Reply #21 on: August 23, 2005, 10:33:50 am »
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.
You said "mysql interaction is easy", at which point I told you to code me something like phpMyAdmin. I have used cPanel for the last 3 years,  i am aware that it exists so shut it.
[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 #22 on: August 23, 2005, 12:54:14 pm »
it's simple. however to create a program like phpMyAdmin takes time. time which i dont like spending on something that a lot of people will not use. even if it is better than phpMyAdmin.

Offline Quik

  • Webmaster Guy
  • x86
  • Hero Member
  • *****
  • Posts: 3262
  • \x51 \x75 \x69 \x6B \x5B \x78 \x38 \x36 \x5D
    • View Profile
Re: [PHP] Basic Blog Tutorial!
« Reply #23 on: August 23, 2005, 01:08:02 pm »
Step 1: Visit http://www.phpmyadmin.net/home_page/
Step 2: Get source.
Step 3: Put your name on it, and release.
Quote
[20:21:13] xar: i was just thinking about the time iago came over here and we made this huge bomb and light up the sky for 6 min
[20:21:15] xar: that was funny

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: [PHP] Basic Blog Tutorial!
« Reply #24 on: August 23, 2005, 01:31:02 pm »
Step 4: Get busted by the GNU cops (Its not public domain, is it?)
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline drka

  • ffdshow > in_mp3.dll
  • Full Member
  • ***
  • Posts: 330
    • View Profile
Re: [PHP] Basic Blog Tutorial!
« Reply #25 on: August 23, 2005, 03:02:06 pm »
it's GPL

that's an evil idea quik ;)

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: [PHP] Basic Blog Tutorial!
« Reply #26 on: August 23, 2005, 03:04:38 pm »
You, sir, are an evil idea.
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline Newby

  • x86
  • Hero Member
  • *****
  • Posts: 10877
  • Thrash!
    • View Profile
Re: [PHP] Basic Blog Tutorial!
« Reply #27 on: August 23, 2005, 05:23:38 pm »
Avant Browser is goddamn shit. It sits right over IE.
- Newby
http://www.x86labs.org

Quote
[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

I'd bet that you're currently bloated like a water ballon on a hot summer's day.

That analogy doesn't even make sense.  Why would a water balloon be especially bloated on a hot summer's day? For your sake, I hope there wasn't too much logic testing on your LSAT. 

Offline Sidoh

  • Moderator
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: [PHP] Basic Blog Tutorial!
« Reply #28 on: August 23, 2005, 05:46:21 pm »
IE works fine for me, thanks.  I have firefox and have used it plenty, I always end up switching back to IE after a few hours.

Anyway, Mangix.  Especially with your current knowledge, you'd never be able to make something that had near the capability phpMyAdmin has.  Just shut face, there's no use arguing.