1
lapsa2000
Verify manifile.php....How ?
  • 2006/10/31 20:39

  • lapsa2000

  • Quite a regular

  • Posts: 247

  • Since: 2006/10/27


Since it is possible to verify if the file mainfile.php is alone a reading? (444).
From out of the server, for example, from the browser.

Regards
Persevera...y seguiras
Perseverando !!!

2
Dave_L
Re: Verify manifile.php....How ?
  • 2006/10/31 21:03

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


XOOPS uses the PHP function is_writable.

if ( is_writable(XOOPS_ROOT_PATH."/mainfile.php" ) ) {
   
xoops_error(sprintf(_WARNINWRITEABLE,XOOPS_ROOT_PATH.'/mainfile.php'));
   echo 
'';
}


You could write a little script that does nothing except that check, but the script would have to be on the server.

if (is_writable('/path/to/mainfile.php')) {
   echo 
'mainfile.php is writable';
} else {
   echo 
'mainfile.php is read-only';
}
?>

3
lapsa2000
Re: Verify manifile.php....How ?
  • 2006/10/31 21:18

  • lapsa2000

  • Quite a regular

  • Posts: 247

  • Since: 2006/10/27


Thank you for answering ... but I do not understand what I have to do .... have I to raise a file to the server?.

You can explain to me please...
Persevera...y seguiras
Perseverando !!!

4
Bender
Re: Verify manifile.php....How ?
  • 2006/11/1 19:12

  • Bender

  • Home away from home

  • Posts: 1899

  • Since: 2003/3/10


- Create a textfile and name it what you like e.g. check_permissions.php
- copy what Dave wrote in block 2 into the file
- upload it to the same directory as your mainfile.php
- call the file in your browser http:///check_permissions.php
Sorry, this signature is experiencing technical difficulties. We will return you to the sheduled signature as soon as possible ...

5
tripmon
Re: Verify manifile.php....How ?
  • 2006/11/1 19:59

  • tripmon

  • Module Developer

  • Posts: 462

  • Since: 2004/2/28


Or, if you are just looking to verify if mainfile.php is not writeable, you can just enter the admin section... if mainfile.php is writeable you will see a big red warning.

6
lapsa2000
Re: Verify manifile.php....How ?
  • 2006/11/1 20:22

  • lapsa2000

  • Quite a regular

  • Posts: 247

  • Since: 2006/10/27


Thanks Bender....copy:

if (is_writable('/path/to/mainfile.php')) {
echo 'mainfile.php is writable';
} else {
echo 'mainfile.php is read-only';
?>

and it saves it like prueba.php, upload to the server, in the same directory where this "mainfile.php" and this is the result:

Parse error: parse error, unexpected $end in C:\Inetpub\vhosts\misitio.com\httpdocs\noticias\prueba.php on line 6


something I am making bad... or as it is the meaning of this?

Sorry for the languge...Im using a translator !!!.
Persevera...y seguiras
Perseverando !!!

7
Dave_L
Re: Verify manifile.php....How ?
  • 2006/11/1 21:05

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


That was my mistake.

There was a missing "}". I fixed my post above and added that line.

8
lapsa2000
Re: Verify manifile.php....How ?
  • 2006/11/1 21:54

  • lapsa2000

  • Quite a regular

  • Posts: 247

  • Since: 2006/10/27


Ok, but slightly this evil,

"The page cannot be found...."

Assurance is the route,

Route where one finds the file "mainfile.php" :
http://www.misitio.com/noticias/mainfile.php

----------------------------------------------
If (is_writable ('/path/to/mainfile.php ')

Does this line remain equal? Or that I have to apply route?

Help !!!!!!!!!!!!!!!!!!!!!
Persevera...y seguiras
Perseverando !!!

9
Dave_L
Re: Verify manifile.php....How ?
  • 2006/11/2 11:50

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


You have to replace "/path/to" with the correct path.

10
lapsa2000
Re: Verify manifile.php....How ?
  • 2006/11/2 14:41

  • lapsa2000

  • Quite a regular

  • Posts: 247

  • Since: 2006/10/27


But this it is my problem, not which is the correct path, I have tried with:

if (is_writable('/noticias/mainfile.php')) {

if (is_writable('/httpdocs/noticias/mainfile.php')) {

if (is_writable('/www.misitio.com/httpdocs/noticias/mainfile.php')) {

if (is_writable('/vhosts/www.misitio.com/httpdocs/noticias/mainfile.php')) {

if (is_writable('/Inetpub/vhosts/www.misitio.com/httpdocs/noticias/mainfile.php')) {

if (is_writable('/C:/Inetpub/vhosts/www.misitio.com/httpdocs/noticias/mainfile.php')) {

if (is_writable('/www.misitio.com/noticias/mainfile.php')) {


And the restultado is:

Parse mistake: parse mistake, unexpected $end in C:\Inetpub\vhosts\misitio.com\httpdocs\noticias\prueba.php on line 7


I do not still have mas options!!! Or if?
Persevera...y seguiras
Perseverando !!!

Login

Who's Online

260 user(s) are online (180 user(s) are browsing Support Forums)


Members: 0


Guests: 260


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits