Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 132,602 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 957 people online right now. Registration is fast and FREE... Join Now!




Getting Value From File

 
Reply to this topicStart new topic

Getting Value From File

fyrestorm
post 18 Oct, 2002 - 09:57 AM
Post #1


D.I.C Lover

Group Icon
Joined: 4 Apr, 2002
Posts: 3,103



Thanked 2 times

Dream Kudos: 228
My Contributions


if i have a php file that will get a value that i need, how do i call that value, i thought i could do an include, but it's not working...
User is offlineProfile CardPM

Go to the top of the page

arniie
post 18 Oct, 2002 - 10:02 AM
Post #2


D.I.C Addict

****
Joined: 8 Oct, 2002
Posts: 999

you need to pass it to the file - in the URL or start a session - call it form a db theres 100's of ways of calling a value.
Im not sure what exactly u mean?
User is offlineProfile CardPM

Go to the top of the page

fyrestorm
post 18 Oct, 2002 - 11:03 AM
Post #3


D.I.C Lover

Group Icon
Joined: 4 Apr, 2002
Posts: 3,103



Thanked 2 times

Dream Kudos: 228
My Contributions


ok, i have a page that calculates a value, i have another page that needs that value, how do i manage that?
User is offlineProfile CardPM

Go to the top of the page

capty99
post 18 Oct, 2002 - 11:25 AM
Post #4


the real kya

Group Icon
Joined: 26 Apr, 2001
Posts: 9,137



Thanked 15 times

Dream Kudos: 550
My Contributions


doing an include should work perfectly.
show us the code plz.smile.gif
User is offlineProfile CardPM

Go to the top of the page

arniie
post 18 Oct, 2002 - 11:32 AM
Post #5


D.I.C Addict

****
Joined: 8 Oct, 2002
Posts: 999

say the value was $value

make the link to the next page nextpage.php?value=$value

then on the next page, you can get the variable

HTTP_GET_VARS[value]

This is a quick and dirty way to do it - capty99 prob. has a good way
User is offlineProfile CardPM

Go to the top of the page

Quik
post 18 Oct, 2002 - 11:40 AM
Post #6


D.I.C Lover

Group Icon
Joined: 6 Mar, 2001
Posts: 3,750



Thanked 1 times
My Contributions


you dont even need "HTTP_GET_VARS[value]" in most cases..

'$value' will already be registered if it's in the domain.

so, without using 'HTTP_GET_VARS[value]' you could write


if($value !="pie"){ }
User is offlineProfile CardPM

Go to the top of the page

Spider
post 18 Oct, 2002 - 01:30 PM
Post #7


Arachnid

****
Joined: 10 Jul, 2002
Posts: 769


My Contributions


alternatively you could post it with a form, which would hide the value.

not much point unless you want to hide the value though...
User is offlineProfile CardPM

Go to the top of the page

skyhawk133
post 18 Oct, 2002 - 02:13 PM
Post #8


Head DIC Head

Group Icon
Joined: 17 Mar, 2001
Posts: 14,846



Thanked 45 times

Dream Kudos: 1650

Expert In: Web Development

My Contributions


the way I do this is to put the variable in the code

CODE
$id="18";
include('whatever.php');


then when you include the whatever.php it has the id variable set to whatever you want smile.gif
User is offlineProfile CardPM

Go to the top of the page

fyrestorm
post 18 Oct, 2002 - 02:44 PM
Post #9


D.I.C Lover

Group Icon
Joined: 4 Apr, 2002
Posts: 3,103



Thanked 2 times

Dream Kudos: 228
My Contributions


thanks a bunch chris, that solved my problems...
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 02:07AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month