
sonny
Members-
Posts
30 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
sonny's Achievements

Member (2/5)
0
Reputation
-
Guess again. We don't care if you "lose it". We're volunteers here. We don't get paid a cent for helping. If you get an attitude, there are hundreds of other people who need our help, and will show a grain of respect. Have a nice day. Just think about this for a moment, why even add your 2 cents then? other then to be a wise guy, I never asked you or anone in purticular for anything, I simply posted a tread for some minor help thats all, Guess what, I guessed wrong I guess, I'll speak in your native tongue maybe it will sink in deeper. what a smart ... you are man
-
The code above is still not working right This is the reason I was asking for help my way, I need to have a 0 in the file to start Plus every time the number is updated it pushws it to the right with a space in front, something is not right with this code. I figured someone might have a fresh way to do this the whole basics behind this is so that I can have a setting for limiting emails, I am not a pro not even close, just trying but I cannot stand someone trying to make a fool out of me thats why I lost it, I don't think anyone on here would want that.
-
Ok, $n = 0; $fh = @fopen('count.txt', 'r+') or die('Error in opening file for read & write'); $n = fread($fh); if ($n < 3) { ftruncate($fh, 0); @fwrite($fh, ++$n) or die ('Unable to write to file!'); } else { print "Limit Reached\n"; } fclose($fh); This is giving me Warning: Wrong parameter count for fread() error
-
You didn't put nothing together for me, stop it, your just trying to get the last word in, and look good, you two guys where just trying to to make a fool out of me. People like you are ruining this forum.
-
What? no one will delete my account, I never read anything about signing up, was a lifetime thing? you make it sound like that was a privilege or something, there should be a delete button in profile its a commonsense and fair thing to have. You and that other guy are punk wise guys, this forum is useless because of people like you! go write yourself some code on politeness when you get some time, and share that with your bro above.
-
Does anyone know how I can delete my account on here? if there is no way, please can a admin remove me, I do not need wise a@# remarks like that, what would have been the big deal anyway. Ive seen people on here ask for 100 times more help on writing code then this.
-
I am converting perl scripts over to php does anyone know how to convert this code below over to php code? { my $n = 0; open (FH, "<", 'count.txt') or die "$!"; $n = <FH>; close FH; if ($n < 10) { open (FH, ">", 'count.txt') or die "$!"; print FH ++$n; close FH; } else { print "Limit reached\n"; exit(0); } @mail('$to, $subject, $message, headers'); Thanks Sonny
-
Do you know another simple way to do this?, if so, can you show me? phpMyBackupPro works so I know it can be done Thanks Sonny
-
Hi I am trying to backup a single complete database using a simple php script I currently use phpMyBackupPro it works fine but is a little to powerful for what I need. I have tried to implement the following but cannot get it to work, it appears to connect and it creates the backup .gz file but it contains nothing inside it. can someone please see what I am doing wrong. <?php $dbhost = 'testdb.hostedresource.com'; $dbname = 'testname'; $dbuser = 'testuser'; $dbpass = 'MyPassword'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); mysql_select_db($dbname); $backupFile = $dbname . date("Y-m-d-H-i-s") . '.gz'; $command = "mysqldump --opt -h $dbhost -u$dbuser -p$dbpass $dbname | gzip > $backupFile"; system($command); mysql_close($conn); ?> Thanks Sonny
-
Thank you, just the "AND" instead of "&&" did it Sonny
-
Hi folks I would like to delete a row based on a keyword But only if another field matches vcode="0" as well my delete from query is below, but does not work, I am very new to this $dkey="%".$keyword."%"; mysql_query("DELETE FROM visits WHERE url LIKE '$dkey' && vcode='0'"); Thanks
-
Good question, I only display the first hit for any given ip, I then link them individually to a more detailed type of display like from and visited data. Example this is what it looks like (27) 123.456.789 Sunnyvale California United States (15) 1235.736.87 Toronto Ontario Canada I figured that count query out, this is what I have now and it works great I used something like this $result1 = mysql_query("SELECT 1 FROM visits where ip='$ip'"); $num_rows = mysql_num_rows($result1); Note the result1, which distinguished it from result in the first query which gets the $ip in the first place Thanks
-
I have a php page that inserts data into a MSQL DB on page load Is there a way to exclude myself by either IP address or hostname "partial string maybe" from being logged? //Start if (isset($_SERVER['HTTP_REFERER'])) { $refer = $_SERVER['HTTP_REFERER']; } else { $refer = "Referer NA</b>"; } if (isset($_SERVER['REMOTE_HOST'])) { $host = $_SERVER['REMOTE_HOST']; } else { $host = "Host</b>"; } //end $ua=$_SERVER['HTTP_USER_AGENT']; //$page=substr($_SERVER['PHP_SELF'],1); $now=time(); $queryup="UPDATE visits SET vcode='0' WHERE ip='$ip' && page='$page'"; $resultup=mysql_query($queryup) or die(mysql_error()); $query="INSERT INTO visits VALUES('NULL', '$ip', '$host', '$refer', '$ua', '$page', '$flag', '$country', '$region', '$city', '$now', '1')"; $result=mysql_query($query) or die(mysql_error()); Thanks
-
Your right about that query on top of a query man that was crazy you should have seen what happened when I loaded that!!! My test database has a table named "visits" 3 fields named "id", "ip_address" and country I would like to display the total row count for the IP followed by the ip address and country Like: 4 243.726.9876 United States I was running a Query to get the info,THE IP ADDRESS, then another Querry to count the rows related to that ip address, which created a bad never ending loop. Thanks for helping me Sonny
-
Please can a experienced PHP person take a look at this below do I need 2 query's or is there a way to do it all at the same time? $query=" SELECT * FROM visits WHERE page='$page' && vcode='1' ORDER BY id DESC LIMIT 5"; $result=mysql_query($query) or die(mysql_error()); while($row =mysql_fetch_array($result)) { $lip=$row['ip']; $id=$row['id']; $page=$row['page']; $result = mysql_query ( "SELECT count(*) from visits where `ip`='$lip'" ); while($row =mysql_fetch_array($result)) $num_rows = mysql_num_rows($result); <td>$num_rows</td><td>$lip</td><td>$page</td> this is a very simple example of what I am trying to do, I want to display the row count for a ip address, then the auctual ip, etc This does not work, does anyone know why? if so can you please point out why? it keeps displaying "1" when I know my test ip address has about 20 hits in the database