Variables!!

This is a discussion on "Variables!!" within the PHP Forum section. This forum, and the thread "Variables!! are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Mar 27th, 2006, 16:06
New Member
Join Date: Mar 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Variables!!

Hello
I am trying to pass variables accross several pages so as i can access ALL the variables in a final script. How is this achieved?

Any suggestions please?

ThankYou
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Mar 27th, 2006, 16:11
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Variables!!

you could either use global variables, session variables, or pass them using the GET method with a query string in the URL
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Apr 19th, 2006, 20:18
Junior Member
Join Date: Apr 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Variables!!

im pretty sure you could use external php files but that would probably make things more complicated. for example:

Code: Select all
<?php
$filename="name of file here";
$vars=fopen($filename, "r");
fread($vars, filesize($filename));
?>

and then go from there
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Apr 19th, 2006, 21:03
Most Reputable Member
Join Date: Aug 2005
Location: North Wales, United Kingdom
Age: 21
Posts: 1,093
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Variables!!

Theres a reason global variables were invented
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Apr 20th, 2006, 18:21
Junior Member
Join Date: Apr 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Variables!!

lol.... i thought of another way though too.


This is your document with the variables you want to use. Save it titled "whatever.inc"
Code: Select all
<?php
$variable_one="blah";
$variable_two="blah, blah";
?>
In your main document just include this:
Code: Select all
<?php
include("whatever.inc");
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Apr 23rd, 2006, 02:38
Junior Member
Join Date: Apr 2006
Location: WebmasterGround.com
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Variables!!

Yes. Global variables are the way to go. You can also store the variables and include them in all your PHP files.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Apr 25th, 2006, 15:39
New Member
Join Date: Mar 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Variables!!

Hi

Thanks for the advice everyone

I will give your suggestions a go...

thanks again
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
variables

Thread Tools

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 On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use variables that pulls in another .php ragnar21583 PHP Forum 2 Apr 26th, 2007 17:53
PhP variables added to XML mavedog21 PHP Forum 0 Nov 28th, 2006 16:09
Session variables ideleon PHP Forum 2 Feb 7th, 2006 08:04
Get URL and use variables JamieH PHP Forum 2 Jan 1st, 2006 03:13
Session Variables ekendricks Classic ASP 7 Aug 26th, 2003 10:42


All times are GMT. The time now is 03:27.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42