Jump to content


Photo

debuging cPanel type interface


  • Please log in to reply
5 replies to this topic

#1 discorevilo

discorevilo
  • Members
  • Pip
  • Newbie
  • 9 posts

Posted 05 April 2006 - 09:05 PM

i have made a cPanel type File Manager for editing selected pages only however when it saves them it puts a \ by all the " and ' witch i cant have it doing can anyone help... here's the code i am using to save the files
[a href=\"http://www.olliespage.net/stuff/stuff2.txt\" target=\"_blank\"]http://www.olliespage.net/stuff/stuff2.txt[/a] (i couldnt post the code so i had to link to it)


#2 Hooker

Hooker
  • Members
  • PipPipPip
  • Advanced Member
  • 193 posts
  • LocationWales, UK

Posted 06 April 2006 - 12:40 AM

Try looking into the "stripslashes()" function.

#3 discorevilo

discorevilo
  • Members
  • Pip
  • Newbie
  • 9 posts

Posted 06 April 2006 - 01:24 AM

umm where would i have to put it to remove the slashes that are wirten?

#4 khendar

khendar
  • Members
  • PipPipPip
  • Advanced Member
  • 78 posts

Posted 06 April 2006 - 01:42 AM

I assume you mean its putting slashes inside the content of the file correct?

In which case you need to call stripslashes() on the $somecontent variable prior to writing it to the file.

#5 DrDre

DrDre
  • Members
  • PipPipPip
  • Advanced Member
  • 35 posts

Posted 06 April 2006 - 02:09 AM

if(magic_quotes_gpc()) { $somecontent = stripslashes($somecontent); }
if (fwrite($handle, $somecontent) === FALSE) {

[a href="http://forums.fanetworks.net" target="_blank"][/a]
» faNetworks Webmaster. [[a href="http://fanetworks.net" target="_blank"]fanetworks.net[/a]]
» faSoftware Developer [[a href="http://software.fanetworks.net" target="_blank"]software.fanetworks.net[/a]]
» faForums - php Resource + more [[a href="http://forums.fanetworks.net" target="_blank"]forums.fanetworks.net[/a]]
» Experienced php Coder - Ill help anyone I can if I have time ;)

#6 discorevilo

discorevilo
  • Members
  • Pip
  • Newbie
  • 9 posts

Posted 07 April 2006 - 09:49 PM

right i've sorted that now umm i need help with listing directorys & files... i need to have it spit so that directorys have ...
<tr><td width=50 align=left><a href="list.php?dir=<? echo $dirnam; ?>" target="filemain"><img border=0 src="images/i-directory.gif"></a></td><td align=left><a href="list.php?dir=<? echo $dirnam; ?>" target="filemain">
     <? echo $dirnam; ?></a></td><td>0 k</td><td><? echo substr(sprintf('%o', fileperms('<? echo $dirnam; ?>')), -4); ?></td></tr>
($dirnam must be the name of the directory and it must be able to do this for every directory in the folder its in)
and then after all the directorys are listed then the files must be listed like so...
<tr><td width=50 align=left><a href="select.php?dir=<? echo $filepath; ?>" target=infofr><img border=0 src="images/i-regular.gif"></a></td><td align=left><a href="select.php?dir=<? echo $filepath; ?>" target=infofr>
     <? echo $filename; ?></a></td><td>0 k</td><td><? echo substr(sprintf('%o', fileperms('<? echo $filepath; ?>')), -4); ?></td></tr>
($filepath must be the full and proper path to the file from the root directory [C:/appserv/www/])
can anyone help with a code to do this?





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users