[solved] editing a file online... script nearly made

  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Joined: May 21, 2004
  • Posts: 3229
  • Loc: South Africa
  • Status: Offline

Post June 23rd, 2004, 4:34 am

Okay what directory is the edit.php file in?
Watch me grow
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 23rd, 2004, 4:34 am

  • Nem
  • Guru
  • Guru
  • No Avatar
  • Joined: Feb 13, 2004
  • Posts: 1243
  • Loc: UK
  • Status: Offline

Post June 23rd, 2004, 4:36 am

http://www.69kilobytes.co.uk/cp/edit.php
GSDomains.com -Click here - Packages starting from £3.69 a month. 1.5GB Space & 10GB Bandwidth.
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Joined: May 21, 2004
  • Posts: 3229
  • Loc: South Africa
  • Status: Offline

Post June 23rd, 2004, 4:53 am

Okay try this, I think I have figured it out but let me know if it works and I'll explain what happened
PHP Code: [ Select ]
 
<?php
 
 
 
if ($submit) {
 
$fp = fopen("../style/style.css", "w");
 
fwrite($fp, stripslashes($newdata));
 
fclose($fp);
 
}  
 
$fp = fopen("../style/style.css", "r");
 
while (!feof($fp)) {
 
$data .= fgets($fp, 4096);
 
}
 
fclose($fp);
 
?>
 
 
  1.  
  2. <?php
  3.  
  4.  
  5.  
  6. if ($submit) {
  7.  
  8. $fp = fopen("../style/style.css", "w");
  9.  
  10. fwrite($fp, stripslashes($newdata));
  11.  
  12. fclose($fp);
  13.  
  14. }  
  15.  
  16. $fp = fopen("../style/style.css", "r");
  17.  
  18. while (!feof($fp)) {
  19.  
  20. $data .= fgets($fp, 4096);
  21.  
  22. }
  23.  
  24. fclose($fp);
  25.  
  26. ?>
  27.  
  28.  
Watch me grow
  • Nem
  • Guru
  • Guru
  • No Avatar
  • Joined: Feb 13, 2004
  • Posts: 1243
  • Loc: UK
  • Status: Offline

Post June 23rd, 2004, 4:55 am

oh man you the best lol.

i look up to you now.... got to learn hardcore php
GSDomains.com -Click here - Packages starting from £3.69 a month. 1.5GB Space & 10GB Bandwidth.
  • Nem
  • Guru
  • Guru
  • No Avatar
  • Joined: Feb 13, 2004
  • Posts: 1243
  • Loc: UK
  • Status: Offline

Post June 23rd, 2004, 5:02 am

what is a parse error? im tryign to add a header to it.

<? include="filename" ?> that is correct?

or if i put it underneath the ?php

then

include="filename";
GSDomains.com -Click here - Packages starting from £3.69 a month. 1.5GB Space & 10GB Bandwidth.
  • Nem
  • Guru
  • Guru
  • No Avatar
  • Joined: Feb 13, 2004
  • Posts: 1243
  • Loc: UK
  • Status: Offline

Post June 23rd, 2004, 5:04 am

let me fix this one.... :P
GSDomains.com -Click here - Packages starting from £3.69 a month. 1.5GB Space & 10GB Bandwidth.
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Joined: May 21, 2004
  • Posts: 3229
  • Loc: South Africa
  • Status: Offline

Post June 23rd, 2004, 5:06 am

Nem wrote:
oh man you the best lol.

i look up to you now.... got to learn hardcore php


That was just a logic problem. we need to tell the script to get out of the cp folder and look for the style folder
hence the ../ before the style/style.css

A parse error means there is something wrong with your syntax. I need to see the error and then the code you are using to tell you where you are going wrong
Watch me grow
  • Nem
  • Guru
  • Guru
  • No Avatar
  • Joined: Feb 13, 2004
  • Posts: 1243
  • Loc: UK
  • Status: Offline

Post June 23rd, 2004, 5:07 am

i have done it... most of my problems been solved by you.

Thank you very much.
GSDomains.com -Click here - Packages starting from £3.69 a month. 1.5GB Space & 10GB Bandwidth.
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Joined: May 21, 2004
  • Posts: 3229
  • Loc: South Africa
  • Status: Offline

Post June 23rd, 2004, 5:09 am

was a pleasure.

Enjoy!
Watch me grow

Post Information

  • Total Posts in this topic: 24 posts
  • Users browsing this forum: No registered users and 218 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.