NiftyHost Forums (Archive)
PHP Help - Printable Version

+- NiftyHost Forums (Archive) (https://niftyhost.chary.us/support)
+-- Forum: Technology (https://niftyhost.chary.us/support/forum-7.html)
+--- Forum: Coding (https://niftyhost.chary.us/support/forum-12.html)
+--- Thread: PHP Help (/thread-234.html)



PHP Help - YTGraphics - 05-18-2010

im sort of new at php so this might sound stupid but, with php, can you have something like

<?php
$words="This is a paragraph";
?>


on one page then

<?php
echo $words;
?>


on another page and link them together somehow?


RE: PHP Help - austin - 05-18-2010

Sure.

<?php
include('whatever.php')
?>



RE: PHP Help - YTGraphics - 05-18-2010

Thanks!
its not working


RE: PHP Help - Zach - 05-18-2010

On whatever.php, have:

$words = 'blah blah';

On otherpage.php, have:

include 'whatever.php';

echo $words;


RE: PHP Help - YTGraphics - 05-18-2010

oh! ill try that
Thanks! It Worked :D


RE: PHP Help - Zach - 05-18-2010

Yeah. PHP processes statements in a linear fashion, so you need to define $words before you can actually use $words.


RE: PHP Help - YTGraphics - 05-18-2010

(05-18-2010, 08:40 AM)Zack Wrote: Yeah. PHP processes statements in a linear fashion, so you need to define $words before you can actually use $words.

:P


RE: PHP Help - austin - 05-18-2010

Sorry, I was busy and didn't have time to explain :P


RE: PHP Help - YTGraphics - 05-18-2010

its ok :) and lol xiofire gave me a more complicated version to use lol


RE: PHP Help - JonattanD - 06-19-2010

here some php tutorials http://w3schools.com/php/default.asp