Search found 13 matches

by Gemster
Fri May 13, 2011 2:24 pm
Forum: PHP - Code
Topic: delete from mysql ?
Replies: 2
Views: 277

Re: delete from mysql ?

Ok, im a complete noob at this. Im guessing that i need it to get the id of the selected box or somet then delete that ip from mysql but i have no idea on how to do this :/ Any help would be great, or examples that i can test and somehow crete this. Or would it be easyer to just add the work Delete ...
by Gemster
Fri May 13, 2011 7:52 am
Forum: PHP - Code
Topic: delete from mysql ?
Replies: 2
Views: 277

delete from mysql ?

Hi, Ok i have no idea on how to do :/ Basically i have a script that gets info from a mysql database and prints in to a page. I have added checkbox infront of the data and a delete button <?php while($bip = mysql_fetch_array( $data )) { ?> <input name="bcheck" type="checkbox" val...
by Gemster
Fri May 13, 2011 6:47 am
Forum: PHP - Code
Topic: is statement ending code :/
Replies: 8
Views: 684

Re: is statement ending code :/

Thanks Jonah Bron, I decided to rewrite the whole file from scratch and make changed you suggested. Anyways i have it all working now as i need it :D if($_POST['ipSubmit'] == 'Add') { if($ip == "") { echo "<hr>You must add an ip or host"; } elseif($ipnote == "") { echo ...
by Gemster
Thu May 12, 2011 5:44 pm
Forum: PHP - Code
Topic: is statement ending code :/
Replies: 8
Views: 684

Re: is statement ending code :/

Did you try the code I posted (the second one)? Yes ive tryed it but a few problems. When it says ip already exsist it stops at the last "}" still and same with you must add a ip. When no reason is entered it still carrys on with submitting the ip with no reason. when it says Ip has been ...
by Gemster
Thu May 12, 2011 2:21 pm
Forum: PHP - Code
Topic: is statement ending code :/
Replies: 8
Views: 684

Re: is statement ending code :/

The $ip and $ipnote are part of the file at the top and it all works fine apart from the section i posted, well it does work but the last "}" close bracket stops any code below it from working. Like say i have </table> below the last "}" it ignores it, basically it ignore any cod...
by Gemster
Thu May 12, 2011 10:55 am
Forum: PHP - Code
Topic: is statement ending code :/
Replies: 8
Views: 684

is statement ending code :/

Hi, for some reason when this part of the file is activated by pressing a button called "Add" it stops on the last "}" and any code after that gets ignored like the end of a table </table> ect <?php $data = mysql_query("SELECT * FROM IP") or die(mysql_error()); if($_POS...
by Gemster
Thu May 12, 2011 4:43 am
Forum: PHP - Code
Topic: php if statment with mysql table ?
Replies: 5
Views: 373

Re: php if statment with mysql table ?

Okay, I looked at the if statement. Do this instead: if($host == $bip['ip']) It's very important that you understand strings thoroughly: http://php.net/string Ok this works kinda, I have around 6 ips in the table but it is just working on 1 ip not all ips ? :/ Thanks Gemster EDIT: nvm, i got it wor...
by Gemster
Wed May 11, 2011 6:56 pm
Forum: PHP - Code
Topic: php if statment with mysql table ?
Replies: 5
Views: 373

Re: php if statment with mysql table ?

That error gives you critical information, you should look at it and see what it says. Try using mysql_fetch_assoc() instead. http://php.net/mysql-fetch-assoc Ya i have googled and looked at them all, tryed loads of different metheds but still it fails :/ Here is the error: Parse error: syntax erro...
by Gemster
Wed May 11, 2011 6:32 pm
Forum: PHP - Code
Topic: php if statment with mysql table ?
Replies: 5
Views: 373

php if statment with mysql table ?

Hi, in my code i what a section of blacklisted ips. I decided to write these ips to a mysql database but having problems reading them. There are severalk ip's in the database table name IP and just 1 colum(row) called ip. anyways i have made this code: mysql_connect("myhost", "myuser&...
by Gemster
Thu Jul 29, 2010 3:56 pm
Forum: PHP - Code
Topic: problem with this little php ping code
Replies: 9
Views: 977

Re: problem with this little php ping code

Sorry, I dont understand :/

Maybe if u fix the code above and post that then I will understand what you meen.

Thanks
Gemster
by Gemster
Thu Jul 29, 2010 2:27 pm
Forum: PHP - Code
Topic: problem with this little php ping code
Replies: 9
Views: 977

Re: problem with this little php ping code

ok thanks guys, just 1 question, this now works: <?php if(exec('ping -c 1 64.85.163.6')) { echo "IP 64.85.163.6 Is <b><u>Online</b></u>"; } else { echo "IP 64.85.163.6 Is <b><u>Offline</b></u>"; } ?> But this does not work: <?php $ip = '64.85.163.6'; if(exec('ping -c 1 $ip')) { e...
by Gemster
Thu Jul 29, 2010 1:17 pm
Forum: PHP - Code
Topic: problem with this little php ping code
Replies: 9
Views: 977

Re: problem with this little php ping code

What's wrong with it? Are you getting any error messages? It outputs this PING 64.85.163.6 (64.85.163.6) 56(84) bytes of data. 64 bytes from 64.85.163.6: icmp_seq=1 ttl=54 time=98.4 ms --- 64.85.163.6 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/md...
by Gemster
Thu Jul 29, 2010 10:43 am
Forum: PHP - Code
Topic: problem with this little php ping code
Replies: 9
Views: 977

problem with this little php ping code

Hi, im new to php if statments. i have a little ping code that i need help with. <?php if(system('ping -c 1 64.85.163.6')) { echo "online"; } else { echo "offline"; } ?> Baiscally i want it to ping that ip and if it pings then echo Online and if not then echo Offline, that all i ...