Basic PHP help!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
satl
Forum Newbie
Posts: 2
Joined: Mon Jan 19, 2009 4:58 pm

Basic PHP help!

Post by satl »

I have searched for hours, trying to figure this out. Please help me. I barely understand PHP.

I want to have a php page that contains all the variables, so I'm guess it would look something like this, I'm not really sure:

<body>
<?php
$var1 = 10;
$var2 = 4;
$var3 = 7;
$var4 = Hello World;
?>
</body>


Then, I simply want to display those variables on another php page. Could you tell me what exactly is the code I need to display one of the above written variables?

Thanks, Shane
User avatar
it2051229
Forum Contributor
Posts: 312
Joined: Tue Dec 25, 2007 8:34 pm

Re: Basic PHP help!

Post by it2051229 »

there are a lot of tutorials of PHP... type it in google...

Code: Select all

 
<body>
<?php
$var1 = 10;
$var2 = 4;
$var3 = 7;
$var4 = Hello World; 
 
print $var1;
echo $var2;
print $var3;
echo $var4;
?>
</body>
 
satl
Forum Newbie
Posts: 2
Joined: Mon Jan 19, 2009 4:58 pm

Re: Basic PHP help!

Post by satl »

it2051229 wrote:... type it in google...
Maybe easy for you, but I've been there, and done that for over 2 hours!

I got it now though. Thanks!

Shane
User avatar
it2051229
Forum Contributor
Posts: 312
Joined: Tue Dec 25, 2007 8:34 pm

Re: Basic PHP help!

Post by it2051229 »

yeah.. just type it in google .. "PHP TUTORIAL"
Post Reply