Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Having trouble writing to file

Status
Not open for further replies.

PhoenixDown

Programmer
Jul 2, 2001
279
CA
I'm trying to make this script update the variable file but it's not writing.

Take a look:



Please tell me what's wrong and how I can fix it. Thank you. AIM: XCalvin1984
Email: calvin@puremadnezz.com
MSN: xcloud2000x@hotmail.com
Web Site: Yahoo Messenger: xcloud2000x

Contact me for any programming help and whatnot. I'll try my best to help! :)
 
Oke, i viewed the txt files, but i think tha fault is in the php. Can you or post a piece of the code, or set error_reporting(E_ALL)

Then we can see whats wrong.
My first guess is that you dont have the correct rights to files to update them through a browser. Do chmod 777 filename.txt and try again. mcvdmvs
-- "It never hurts to help" -- Eek the Cat
 
If I'm correct, I think your problem might be because you are trying to write your variables from within a function. When you enter a function, you get a 'blank slate' in terms of variables - everything is reset (and the original values are restored when the function ends), unless you declare them or inherit them using
Code:
global
. See for more info. One solution would be to place all your variables in an array, then declare that array to be global (or pass it as an argument to your function).

Oh, and I think you might also be missing a semicolon at the end of your write string.

Finally, your file cp.php defines a function, but doesn't appear to call it (unless I missed something). You could add
Code:
submit_styles("whatever");[code]
before your [code]require
.
(By the way, what do you use $arg1 for?)

-Rob
 
I don't know what's $arg1 is used for. That's what you told me to do in this thread: thread434-161411 did what you told me to do and I STILL can't get it to work. The variables are not writing. AIM: XCalvin1984
Email: calvin@puremadnezz.com
MSN: xcloud2000x@hotmail.com
Web Site: Yahoo Messenger: xcloud2000x

Contact me for any programming help and whatnot. I'll try my best to help! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top