vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   Tutorial : Basics of PHP (https://vborg.vbsupport.ru/showthread.php?t=59260)

MindTrix 01-03-2004 05:15 PM

Well i aint joking i wrote loads :( I guess i should start it up again, might do in a little bit after a beer :)

gldtn 01-04-2004 07:03 AM

Quote:

Originally Posted by Exero
PHP Code:

<?php
if($action == "") {
// Main page coding here
echo("Welcome");
}
elseif(
$action == "news") {
// News coding here
echo("News");
}
elseif(
$action == "about") {
// About coding here
echo("About");
}
elseif(
$action == "search") {
// Search coding here
echo("Search");
}
?>


I think Exero was just trying to show us how to write a sophisticated if statements, which in my opinion could be a great topic you can write about MindTrix... By the way great tutorial, although I found ONE mistake;

You wrote;
Code:

Example

"vBulletin"."Rules"


Would show up as


"vBulletin Rules"

Should'nt it be;
Code:

"vBulletin"."Rules"


Would show up as


"vBulletinRules"

Also how would this show on a browser;
Code:

Here is an example


$userage = 50;
print "The users age in days is ".($userage*365)." days";


Notice the ( . ) symbol connecting everything together.

Gread job, keep it up

MindTrix 01-04-2004 09:09 AM

Thank you for the comments, i am half way doing my next tutorial as it is.

You are correct on what you said, however i am sure i put a space before the " so it looked like

"vbulletin "."rules"

Maybe it got auto corrected, however i will change the first post now as i did not notice my error. Thanks!

MindTrix 01-04-2004 09:14 AM

PHP Code:

$userage 50;
print 
"The users age in days is ".($userage*365)." days"

Would show as

The users age in days is 18250 days

Dean C 01-04-2004 12:40 PM

Exero - this is a lot clearer:

PHP Code:

if($_REQUEST['action'] == 'blah')
{
dothis();
}
else if(
$_REQUEST['action'] == 'moo')
{
dothat();
}
else
{
donothing();



MindTrix 01-04-2004 12:46 PM

True Mist but both have nothing to do with this tutorial :)

N_Jay 01-06-2004 01:57 AM

I am looking for a good book on PHP programming.
I am a non-programmer, so I need something I can flip through as I need to to "adjust", fix, or just understand some vBulletin hacks and other PHP files.

Anyone have a recommendation?

And Thanks MindTrix for the tutorial, every littel bit helps.

MindTrix 01-06-2004 04:22 AM

I personally use a two books now.
One called SAMS Teach yourself - PHP, MYSQL and Apache.

And then

SAMS Teach yourself PHP

They aint cheap though, Around $30 or £20

Dean C 01-06-2004 10:06 AM

Worth every penny though :) ^^

MindTrix 01-06-2004 04:10 PM

True they are definetly worth it. The book with all 3 in it, i am borrowing from the library and even comes with a cd complete with all 3, and a step by step guide to installing them onto your pc for a local server.

The other one just delves deeper into PHP, its hard too take in sometimes but the more you read it, the more you understand it.

At the moment i am onto Arrays :)


All times are GMT. The time now is 07:23 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01298 seconds
  • Memory Usage 1,741KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete