Linky Spy
Moderator: General Moderators
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
Linky Spy
HI,
I need help making a script to store 3 thing's.
I need to store $sn $page $date.
The problem is, I dont have a mySQL, nor do I want to use it, and I am using PHP3.
I have to use fopen() and stuff, However I do not know how to do that very well, So I was wondering if anybody can mybee help me with it.
The way I want them to be stored is in any file and I want the format to be
$sn $page $date <br>
$sn $page $date <br>
$sn $page $date <br>
...
Thank You!
I need help making a script to store 3 thing's.
I need to store $sn $page $date.
The problem is, I dont have a mySQL, nor do I want to use it, and I am using PHP3.
I have to use fopen() and stuff, However I do not know how to do that very well, So I was wondering if anybody can mybee help me with it.
The way I want them to be stored is in any file and I want the format to be
$sn $page $date <br>
$sn $page $date <br>
$sn $page $date <br>
...
Thank You!
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
ok i tried this but i got a error
error:
Code: Select all
<?php
$date = date("F j, Y, g:i a");
$ip = @$REMOTE_ADDR;
$filename = 'visit_log.txt';
$somecontent = "echo $sn; echo $page; echo $from; echo $date; echo $ip; ";
if (is_writable($filename)) {
if (!$handle = fopen($filename, 'a')) {
echo "Cannot open file ($filename)";
exit;
}
if (fwrite($handle, $somecontent) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
echo "Success, wrote ($somecontent) to file ($filename)";
fclose($handle);
} else {
echo "The file $filename is not writable";
}
?>Line 6:Fatal error: Call to unsupported or undefined function is_writable() in /web/u54/www22882/www/visit.php3 on line 6
if (is_writable($filename)) {
Allright!nickman013 wrote:ok i tried this but i got a error
Fatal error: Call to unsupported or undefined function is_writable() in /web/u54/www22882/www/visit.php3 on line 6
When you get an error while developing, first, check the function in the manual: http://us2.php.net/manual/en/function.is-writable.php
Since it was added in PHP4, that function is not available.is_writable
(PHP 4, PHP 5)
Using PHP3 is insecure, poorly documented, and virtually *no one* has experience with it anymore. Its not available for download on the main site, or maintained.
Why do you continue using it?
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Set up your own local development server, and guess what.. its FREE!
http://hotscripts.com/PHP/Software_and_ ... index.html
http://hotscripts.com/PHP/Software_and_ ... index.html
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
Try stuff out on your own computer first. That way, you can get whatever you want, and then look for a host that supports exactly that. Will save you the headache of making your vision fit with your webhost.nickman013 wrote:i cant stand this, i am going to get my own host, the reason i cant move to a new host is becasue it takes 2 weeks. also it isnt my host lol. its my friends but im in charge of the site. whats a good, cheap host?
A good place to start is http://www.apachefriends.org
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
Good to hear! Hope it saves you pulling your hair out while working on a remote server. It's really handy to have stuff work on your own machine. Instant previews!nickman013 wrote:yup i went to the hot scripts site and did xampp ... i love it
now i can finally do stuff
btw, the code works now..
You can send emails straight from php using the mail() function.nickman013 wrote:i just need to find a email server.
Can you rephrase that? I don't understand what you mean by "break"?nickman013 wrote:and i need to know how to make a break in a php file..
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
Code: Select all
echo '<br />';- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York