[SOLVED] my directories revealed!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sweenyman
Forum Commoner
Posts: 29
Joined: Fri Feb 04, 2005 11:28 am
Location: Ireland

[SOLVED] my directories revealed!!

Post by sweenyman »

Hi Guys
Hope you can help
I am creating a site that allows you to upload images. When I was testing the site I just left the image fields empty which now shows a box with an x on it..Thats ok.When this box is clicked it reveals all my directories in new window(which would normally be the enlarged picture of original image).I'm using normal javascript to open window. Any ideas why or how to prevent this
Cheers
Sean 8O
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

post some code, along with what server you are using, the OS this server is sitting on, php version...
User avatar
PrObLeM
Forum Contributor
Posts: 418
Joined: Sun Mar 07, 2004 2:30 pm
Location: Mesa, AZ
Contact:

Post by PrObLeM »

try putting a blank index.html file in there so when someone tries to goto the directory it will end up being blank
sweenyman
Forum Commoner
Posts: 29
Joined: Fri Feb 04, 2005 11:28 am
Location: Ireland

Post by sweenyman »

feyd wrote:post some code, along with what server you are using, the OS this server is sitting on, php version...
Hi feyd lookin at below it may have something to do with the images directory? What do you think
Im on windows PHP4 Apache MySql



<div align="center"><a href="#" on Click="window.open()"></a>
<a href="javascript:void(0);" onClick="window.open('images/adimages/<?php echo $row[x_image];?>', 'imagewin', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, width=600, height=500, left=300, top=100')"><img src="images/adimages/<?php echo $row[x_image];?>" height="120" width="160" border="0"></a></div>


ps this is giving me trouble too

$sql = "DELETE FROM clients WHERE x_clientid = '$clid'";
when I echo the sql I get
DELETE FROM clients WHERE x_clientid = ' mous67894'
It dosent happen though ..but no errors I've tried leaving out quotes etc
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

placing an index.html or other index file should help, however, you should also make sure $row['x_image'] actually evaluates to something, anything, a default value..

as for your delete problem, is there a client id that's ' mous67894' I would bet it's 'mous67894' notice the leading space is removed.
sweenyman
Forum Commoner
Posts: 29
Joined: Fri Feb 04, 2005 11:28 am
Location: Ireland

Post by sweenyman »

feyd wrote:placing an index.html or other index file should help, however, you should also make sure $row['x_image'] actually evaluates to something, anything, a default value..

as for your delete problem, is there a client id that's ' mous67894' I would bet it's 'mous67894' notice the leading space is removed.
Thanks for the image problem

Re the other problem...
I noticed the whitespace before but I dont know how its getting there.
I have actually tried substituting $clid for the actual string mous67894 and it works I just dont know where the leading space is coming from. Once the var is in it wont work any time but if i put actual value in it works every time.
Confused
Sean
sweenyman
Forum Commoner
Posts: 29
Joined: Fri Feb 04, 2005 11:28 am
Location: Ireland

Post by sweenyman »

feyd wrote:placing an index.html or other index file should help, however, you should also make sure $row['x_image'] actually evaluates to something, anything, a default value..

as for your delete problem, is there a client id that's ' mous67894' I would bet it's 'mous67894' notice the leading space is removed.
proplem solved.
<a href="cutclcont.php?clid= <?php echo $row['x_clientid']; ?>
<a href="cutclcont.php?clid=<?php echo $row['x_clientid']; ?>
The space before <?php echo....

Thanks feyd and PrObLeM for your prompt responses. Much appreciated.
Sean
Post Reply