Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include ("lastspoke_config.php");
- // connect to the mysql server
- $link = mysql_connect($server, $db_user, $db_pass)
- or die ("Could not connect to mysql because ".mysql_error());
- // select the database
- mysql_select_db($database)
- or die ("Could not select database because ".mysql_error());
- $q = $_REQUEST['chanhost'];
- $chan = str_replace('A_N_D', '&', "$chan");
- $chan = str_replace('P_L_U_S', '+', "$chan");
- $w = "SELECT chanhost FROM lastspoke_undernet WHERE chanhost='$q'";
- $resultcheck = mysql_query($w) or die ('query failed error 1');
- if (mysql_num_rows($resultcheck) >0)
- {
- $query = "UPDATE lastspoke_undernet SET chanhost='$_REQUEST[chanhost]',lastspoke='$_REQUEST[lastspoke]',nickname='$_REQUEST[nickname]',arguments='$_REQUEST[arguments]' WHERE chanhost='$q'";
- $result = mysql_query($query) or die('query failed:'.mysql_error());
- if (isset($result))
- {
- echo '<div align="center">Your information has been updated.</div>';
- }
- } else {
- $query = "INSERT INTO lastspoke_undernet (chanhost, lastspoke, nickname, arguments) VALUES ('{$chanhost}', '{$_REQUEST['lastspoke']}', '{$_REQUEST['nickname']}', '{$_REQUEST['arguments']}')";
- $result = mysql_query($query) or die('query failed'.mysql_error());
- if (isset($result))
- {
- echo '<div align="center">Your information has been entered into the database.</div>';
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement