Dman8568
Members-
Posts
56 -
Joined
-
Last visited
Everything posted by Dman8568
-
For what you are wanting to do it use a combination of fopen, fwrite, and fclose. Here is a very basic example: >// This example asumes you have whatever you want to be writen to the file in a variable named "$data" // Also, your target file needs be CHMOD 0777 (or you will get an error back) // Open Connection to Target File $handle = fopen("[Filename]", "a"); // the "a" is the mode, a = "open for writing, place start position at END of file // Write Data to file fwrite ($handle, $data); // Close Connection fclose($handle); Referances for each function: fopen:http://us2.php.net/manual/en/function.fopen.php fwrite:http://us2.php.net/manual/en/function.fwrite.php fclose:http://us2.php.net/manual/en/function.fclose.php I hope this helps
-
WOW! Thanks for all the responses. I now have the function up-and-running. (By the way, did I mention that: ) Thanks again
-
I'm developing a Calendar of Events for a friend's site, and came across a roadblock. What I'm wanting the script to do is loop thought the Events (loaded from a Database), and for every even record output a background color. So the resulting list will be: Non-Color Color Non-Color Color Here is how I have coded so far: ># $Events is where the Database was loaded into # $i is the row number # $row is the row's data # $RETURN is the code that will be returned out of the function # Please Note: I have not debugged this yet, so there are probably errors foreach($Events as $i => $row){ $RETURN.= "<TR>\n"; $RETURN.= " <TD>\n"; $RETURN.= " <strong>".$row[event]."</strong><br>\n"; if (date("F", $row['start']) != date("F", $row['end']) // Different Months $RETURN.= " <em><font size=1>".date("l j, Y", $row['start'])." - ".date("l j, Y", $row['end'])." <br> ".$row[location]."</font></em>\n"; } elseif (date("d", $row['start']) != date("d", $row['end']) // Different Days $RETURN.= " <em><font size=1>".date("l j".date("-j", $row['end']).", Y", $row[start])." <br> ".$row[location]."</font></em>\n"; } else $RETURN.= " <em><font size=1>".date("l j, Y", $row[start])." <br> ".$row[location]."</font></em>\n"; } } Is there any easy way to determine if $i is even or odd?
-
the target directory is inside my media folder. The media folder is then sub-divided by file extentions (htm folder, img folder, etc.) All the sub-division folders were created by me through SmartFTP. Therefor, I would need to set the folder to 0777? But isn't that a security risk? (setting a public folder to 0777)
-
I am currently writing a file management service, in PHP, for my website where Admins can upload viewable files (html, pdf, txt, ect.) for members to view. All is working fine until I started to code the "Delete File" portion. When I tell it to delete a file I get a "Permission denied" error back. I have tried both local file system address (/home/[cpanelname]/...) and I get the “Permission denied” error. And when I try the URL (http://www...) I get a "File does not exist" error, when in fact it does. Is the unlink command blocked on the servers and if so, is there a work-a-round? Many Thanks, David
-
Works fine in West Virginia Average Time: 47 ms
-
I'm game for this "adventure".....
-
But if I would do it that way, with Apache loaded in Windows, wouldn't the Paths be Windows based (C:/... ), and not LINUX Based (/home/... ). (That the whole reason I'm trying to emulate LINUX)?
-
If i'm trying to emulate LINUX wouldn't I have to install the Apache Server inside the LINUX Enviroment provided by cygwin?
-
Some Answers: ~ This sounds like exatly what I'm looking for. My one problem now is getting an Apache Server to run inside this emulated LINUX [see answer to TCH-Bruce's reply] ~ I have tried this, but as my site is very dynamic I am having troubles getting an included file to return needed variables to the parent program. (i.e. include"[relative path]" didn't work, but include"[absolute path]"; ~ Looking into this, this sounds like a VERY nice Apache Install package. However, I am currently having problems loading the installer program through cygwin. (It has been returning an "File/Dir Dosen't Exist" err when I run the launch command) ~ Because the PC that I currently use is not mine, but my family's. (If it was mine, I probably would load LINUX on it)
-
Hi, I was wondering if there was anything out on the net that can emulate a Linux environment. What I have is Windows EX running an Apache Server w/ PHP installed. Now when I develope my site localy I have to use windows filepaths (i.e. C:/[file-path]), and when I upload them I have to change them back to Linux paths ( /home/[file-path] ). So, basicly is there anything out there that can cause Apache to run in a emulated Linux so I don't have to change all the file paths when I go to uplead? Thanks, Dman8568
-
[bump] I'm sorry... I know I'm not suposed to do this...
-
Hi, How can I combine a 'From:' and a 'Content-type:' Header. What I'm trying to do is send HTML through E-Mail. Here is shat I have so far: >mail([Address], [Subject], [Message], "From: BSA Troop 6 <mail@wvtroop6.org>\r\nContent-type: text/html\r\n"); I hope this made sense. Many Thanks, Dman8568
-
Would anyone know how I could do this? I have a file located at: "[hidden]/plans/admin/plans.cgi" that I want protected. I have a PHP program that "hides" the real address to the file by using frames. However, if the user views the source, they can get to the acuall page. What I'm wanting to know is; Is there a way to allow the page throught the framset while blocking a direct link (i.e. typing the address into the address bar)? - OR - Is there someway I could "encrypt" the source that will still allow a browser to work? (I realy hope this hade sense) Many Thanks, Dman8568
-
Yes I have a folder below the Public_html folder called "system" I have my dir tree set up like this: >/wvtroop/ public_html/ system/ cron/ db/ includes/ sub-routines/
-
So I would put into the cron panel of CPanel >/usr/bin/php -q /home/wvtroop/system/cron/sessions_clean.php In order to run the program at "/home/wvtroop/system/cron/sessions_clean.php" Is this right?
-
Ok, I've tried that, and it didn't work. Here is the top of the script I need to run through cron: >#!/usr/bin/php <?php ... ... ?> Here is the Error Message I'm getting in my Cron Inbox: Any Ideas? Many Thanks, Dman8568
-
Yes, It looks great! Thank You.
-
URL: BSA Troop 6 - Wheeling, WV Title: BSA Troop 6 - Wheeling, WV Description: Boy Scouts of America Troop 6 located in Wheeling, West Virginia Type: Non-Profit Acknowledgement: The TCH Link is at the bottom of the page (right under the site copyrite) Many Thanks, Dman8568 - webmater
-
I have a PHP script I need to run through Cron. I've tried several different things, but I always get an error message sent to my cron E-Mail address I know for PEARL you need to put the path to PEARL at the top of the file. Do you need to do something like that in PHP? Many Thanks, Dman8568
-
Keeep up the good work!
