Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 04-11-2006, 03:15 PM   #1
j03
~~~~~~~~
 
Join Date: Jan 2005
Location: Wales
Posts: 5,556
Send a message via MSN to j03
Default PHP Help

Hi All, i have just started learning PHP, and could do with somone in my MSN contact list, to ask a few questions when i am stuck. Anyone interested in helpin a PHP n00b, please add joe@zebrapie.co.uk!!
__________________

j03 is offline   Reply With Quote
Old 04-12-2006, 04:03 AM   #2
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,006
Default Re: PHP Help

I'm always glad to help people with their web programming questions.

but I'd rather keep it on the forum in public view because then it helps other people as well.
__________________

__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 04-12-2006, 07:02 AM   #3
j03
~~~~~~~~
 
Join Date: Jan 2005
Location: Wales
Posts: 5,556
Send a message via MSN to j03
Default Re: PHP Help

OK, so can i ask a Question I often see PHP websites with things like, index.php?somecontent. How do i do this? Thanks for all the Help, Joe
j03 is offline   Reply With Quote
Old 04-12-2006, 08:52 AM   #4
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,006
Default Re: PHP Help

it's called a get request.

firstly the page is loaded
index.php?variable=hello

then a variable name is passed
index.php?variable=hello

then the data is passed
index.php?variable=hello

to get the data from the address line you simple use either $_GET or $_REQUEST

so
<?php
$variable = $_GET['variable'];

print "the data is $variable";
?>

or
<?php
$variable = $_REQUEST['variable'];

print "the data is $variable";
?>

to pass more than one variable simply put an & in the address line.

index.php?first=hello&second=goodbye
<?php
$variable1 = $_GET['first'];
$variable2 = $_GET['second'];

...

?>
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 04-12-2006, 05:38 PM   #5
j03
~~~~~~~~
 
Join Date: Jan 2005
Location: Wales
Posts: 5,556
Send a message via MSN to j03
Default Re: PHP Help

Thanks for that( http://joesstuff.co.uk/test.php?page=Hello%20world). How would i go about doing that in dreamweaver, and getting it only to display SOME Content. (I.E., you have One big PHP file, with differents bits of HTML in them.) Do you assing a Vairable to each piece if HTML Code?
j03 is offline   Reply With Quote
Old 04-13-2006, 04:39 AM   #6
In Runtime
 
JediKnight's Avatar
 
Join Date: Apr 2005
Posts: 193
Send a message via AIM to JediKnight Send a message via MSN to JediKnight
Default Re: PHP Help

You dont edit PHP files in dreamweaver, you just do them in notepad, or a basic text editor.
__________________
You know how I roll.
JediKnight is offline   Reply With Quote
Old 04-13-2006, 05:26 AM   #7
j03
~~~~~~~~
 
Join Date: Jan 2005
Location: Wales
Posts: 5,556
Send a message via MSN to j03
Default Re: PHP Help

I do - I like it how it is all colour coded, and it has got lil things that help you. Anyway, i dont have the time to code my whole website in HTML/PHP



Oh, and i managed to do it IN DREAMWEAVER (http://joesstuff.co.uk/testpage.php?variable=page)

I placed this:
PHP Code:
<?php
$variable 
$_REQUEST['variable'];
if (
$variable == page)
include 
"htmltest.html"
?>
in the middle of my page template, where i wanted the content to be, and made a HTML page called "htmltest.html" with the actuall content in.
j03 is offline   Reply With Quote
Old 04-13-2006, 09:48 AM   #8
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,006
Default Re: PHP Help

http://www.computerforums.org/showthread.php?t=28355

that should help.
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 04-13-2006, 10:12 AM   #9
j03
~~~~~~~~
 
Join Date: Jan 2005
Location: Wales
Posts: 5,556
Send a message via MSN to j03
Default Re: PHP Help

-= UPDATE =- Thanks for the Help - I am now in the Prosess of turning one of my websites (joesstuff.co.uk) into a Flash Site! Thanks! (I am sure i will have way more questions, especially about mySQL!
j03 is offline   Reply With Quote
Old 04-13-2006, 01:07 PM   #10
j03
~~~~~~~~
 
Join Date: Jan 2005
Location: Wales
Posts: 5,556
Send a message via MSN to j03
Default Re: PHP Help

Quote:
Originally Posted by root
Thanks for that - I kinnda figured out my self
__________________

j03 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 10:13 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0