![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Too lazy to set a custom title
Industry Role:
Join Date: Jun 2005
Location: 127.0.0.1
Posts: 27,047
|
[php] - howto update variable in external php file
i need some quick php help...
let's say i have a file called x.php with a few variables in it Code:
$a = "2"; $b = "ddd"; Code:
include 'x.php'; thanks
__________________
Make Money
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Chafed.
Join Date: May 2002
Location: Face Down in Pussy
Posts: 18,041
|
format c:
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Too lazy to set a custom title
Industry Role:
Join Date: Jul 2001
Posts: 59,204
|
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Too lazy to set a custom title
Industry Role:
Join Date: Jun 2005
Location: 127.0.0.1
Posts: 27,047
|
thanks for the great help...
__________________
Make Money
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Registered User
Join Date: Oct 2005
Location: The Middle of Nowhere
Posts: 616
|
If you are declaring constants such as "$a = "2";" then the only way to change it from another script would be to either redeclare it in y.php or re-write x.php using a file write.
There may be other options, but without a more in depth look at your complete script, it's difficult to form them. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Too lazy to set a custom title
Industry Role:
Join Date: Jun 2005
Location: 127.0.0.1
Posts: 27,047
|
Thanks Robbie.
i'll look into file write.
__________________
Make Money
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Too lazy to set a custom title
Join Date: Jan 2002
Location: Holland
Posts: 9,870
|
do you want to update the var in the file?
__________________
Don't let greediness blur your vision | You gotta let some shit slide icq - 441-456-888 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
So Fucking Banned
Join Date: Aug 2003
Location: ICQ #23642053
Posts: 19,593
|
Quote:
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Too lazy to set a custom title
Industry Role:
Join Date: Jun 2005
Location: 127.0.0.1
Posts: 27,047
|
Quote:
yes.......
__________________
Make Money
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
Too lazy to set a custom title
Join Date: Jan 2002
Location: Holland
Posts: 9,870
|
Quote:
then the only thing you can do is rewrite file easiest thing is every var on a line like 2 3 4 then $filename = "vars.txt"; $my_vars = file($filename); $my_vars[0] will be 2 if you have changed the vars just save the array.
__________________
Don't let greediness blur your vision | You gotta let some shit slide icq - 441-456-888 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Join Date: Aug 2003
Location: Someplace Windy
Posts: 4,501
|
You need to open and read the file and then rewrite the contents. Something like this (has not been tested)...
PHP Code:
__________________
Perfect Gonzo |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Too lazy to set a custom title
Industry Role:
Join Date: Jun 2005
Location: 127.0.0.1
Posts: 27,047
|
thanks a lot guys.
i think i'll go with grumpy's idea...
__________________
Make Money
|
![]() |
![]() ![]() ![]() ![]() ![]() |