PDA

For continued disscussion on this topic : question.. why doesnt this work?



jewishj
04-22-2001, 07:27 PM
I'm trying to create a PHP guestbook... I can't get it to open viewgb.htm and write to it though... this is what I tried (just as a test before I do the actual guestbook)



<?php

$fp=fopen("viewgb.htm","a+");
fwrite($fp,$text);

---$text is the name of the textbox that I submitted to this script---

fclose($fp);

echo "<a href='viewgb.htm'>view your entry</a>";

?>

Arielladog
04-23-2001, 03:43 AM
Hey jewishj,

1st of all, your code looks correct to me, and second of all, if I test it, it works fine for me. Don't know what else to say... :bambooz:

lorddog
04-23-2001, 07:12 AM
are you getting an error? if so what does the error say?

like maybe the path is incorrect?

do you have a valid value in $text? or is it empty?

Lorddog

jewishj
04-23-2001, 10:07 AM
try it for yourself...

http://65.9.144.72/server%20scripting/test/test.htm

It's some kind of permission denied, but I've checked permission, everything has write permissions...

what is goin on?

I'm running IIS 5.0 on Windows2k

lorddog
04-23-2001, 02:00 PM
what are the permissions set to on the folder it is in and
what permissions are they set to on that file?

Lorddog

jewishj
04-23-2001, 06:47 PM
On The Folder....

All Permissions are checked, all of the permissions are as follows...

-Script Source Access
-Read
-Write
-Directory Browsing
-Log Visits
-Index this Resource

For the documents themselves...


All Permissions are checked, all of the permissions for a document are as follows...

-Script Source Access
-Read
-Write
-Log Visits

None of the files or the folders have "read-only" checked either...

I don't get it....

lorddog
04-23-2001, 10:58 PM
you have crt or ftp? look at the permissions in those programs. only thing I can think of but it seems
that permissions IS the problem.

Lorddog

jewishj
04-24-2001, 01:09 AM
ok, well... In my FTP server I didn't have write permissions activated, however activating them made no difference, is there somewhere besides where I'm going that I need to look at permissions...

I am running IIS 5.0 through windows 2k, here's the path that I take to get to my permissions...

Start->Settings->Control Panel->Administrative Tools->Internet Services Manager->Default Web Server->Prorties->Home Directory (Which has permissions in it)

lorddog
04-24-2001, 01:14 PM
yes I do the same but for file permissions I use both crt and ws_ftp_le version to change and look at.
in the wftp if you right click on a file or folder
then go down to CHMOD (means change permissions kindof)
there are 3 columns that represent you, group, world
numbers are


you group world
r 1 1 1
w 2 2 2
X 4 4 4
and the rows are read, write, execute
I believe you need to give the folder and the file the
same options for reading and executing use 755 or check all first column
the 1,4 on the 2 and 3rd columns.
for writeing use I think 755 is ok or maybe 775 and
for file uploading I think you need 777 for that folder.

just try 755 first and if that don't work expand it up alittle.

also in ws_ftp after you change the CHMOD hit refresh
(may or may not be neccessary)

in CRT if you hit ls -al
it will list files and permissions and to change them its
chmod 755 filename
or
chmod 755 *
for all of the files

I am sure I said somethings wrong but it should get you
where you want.

Lorddog

one thing I missed for anyone thats never done this is in
WS_ftp_le when you right click the file or folder it MUST
be highlighted to give you the option of CHMOD.



[Edited by lorddog on 04-24-2001 at 07:15 AM]

jewishj
04-26-2001, 09:56 AM
umm..

ok at first I didn't understand where to go, but I think you were talking about wsftp, so I went into my wsftp_pro and I don't see CHMOD or CRT anywhere....

where exactly would this be...


thanx

ps.
I tried right clicking and everything else you said in your previous post to reach CHMOD...

lorddog
04-26-2001, 01:33 PM
I'm sorry now that I look at it it will only show up on the right side of ws_ftp_pro not your side(left side),
I am just so use to doing it on the commercial server I use.

with your folder in windows explorer you right clicked it,
hit properties, hit security tab
then you have 3 lists at top
hightlight each one and choose full control
on each should be 3 of them admin/everyone/system
check all 3 of them. check the box allow inheritable
permissions.
then go into the folder and right click the file or
database and check security/check all permissions in there

if that works then perhaps back off the permissions
on the everyone control like their write access

that should do it.

jewishj
04-27-2001, 07:22 AM
already did that....

going that route the only permission that I didn't grant the everyone group was "delete folders and subfolders" and "ownership" permissions.....

lorddog
04-27-2001, 02:03 PM
I tried that test and didn't get a permissions error
unless you turned it off. it seemed to get some error
so I hit stop and all I got was *


I was looking through your site and saw that your gonna run php and asp? on the same machine? or are you networking 2 or more machines.
I ran both on my server last year. Not hard to set up but
my php(version3) would cause my computer to not be
a server all the time so maybe I just missed something
in the config for win2000 but I never got it to work together consistantly.

Lorddog

jewishj
04-27-2001, 02:55 PM
oh...

I was not aware that there were problems running asp and php on the same server....

Well, just because I have tuts on asp doesn't mean that I have to run it....


did you like my site?

lorddog
04-27-2001, 03:06 PM
yep, cool site and I like the way you lay out
the areas.
the only problem i had was with php. there are so many
settings in the config file that I could of missed
something easily. When someone went into my php pages
sometimes after a few page hits it would lock up my server
and not display any pages until I rebooted. It probably
had nothing to do with the asp running anyways. I probably
just didn't set php up completly.

it was as if once you hit a php page it opened some object
that keep sucking up my resources and eventually ran me out
of memmory, like some prehistoric viral monster chomping
on the inerds of my processors!

anyways I was thinking you could use ftp-pro and connect up to your own computer (loopback) and if you know your
login and password then with ftp-pro you could easily
check your permissions. but you may have to set your
server to ftp mode(not sure about this)

Lorddog

jewishj
04-27-2001, 05:07 PM
thanx for all your help, I'll figure it out one way or another, or if I don't I could always find a free host to remotely host my php....


If you think of anything else though, please inform me....

thanx again