Jump to content

rpope904

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

rpope904's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am attempting to write an ad-on for a banner exchange script, I am trying to write a mod to be run on a cron script once daily, what its going to do is connect to the exchange database, get the URLs of the members, open the site and search for our code in it.. It gets the urls, and opens them, but doesn't search for the code, or atleast say it does.. here's the code: <? echo "<b>Users found:</b><br> "; mysql_connect("localhost", "8888888888", "8888888888888"); mysql_select_db("888888888888"); $result = mysql_query("SELECT * FROM `ebp_ad` LIMIT 0, 30 "); while($row = mysql_fetch_array($result)){ file_get_contents($row[url]); if (preg_match("/^x10exchange/", '$data')) { echo "A match was found." .$row[url]. "<br>"; } else { echo "A match was not found." .$row[url]. "<br>"; } } ?> Basically, I just want it to search for x10exchange on the page, I know some of them have it.. Later on, I am going to code it to suspend the member if its not found, but this is just a test.. It returns them all as not found.. here's an example: http://x10exchange.com/forums/usercheck.php
  2. Yeah, I caught that one right after I posted it.. now its giving: couldn't connect to db: Unknown column 'fktest' in 'where clause' fktest is the nickname, and it should be searching under the column nickname..
  3. couldn't connect to db: Unknown column 'username' in 'where clause'
  4. I am having some issues with a script, basically, it just verifies if an account exists, if so tells the user, otherwise adds the data to the database.. I have created the database, username, etc.. The table, users also exists with the correct fields, I manually added some data into them for testing to see if it maybe had to have something in it.. Can you see my error: Code: <?php $ni = $_POST['nickname']; $ch = $_POST['channel']; $nipass = $_POST['nickpassword']; $chpass = $_POST['chanpassword']; $description = $_POST['description']; $HOST = 'localhost'; $DBUSER = 'rpope904_x10chat'; $PASS = '*******'; $DATABASE = 'rpope904_x10chat'; $connection = mysql_connect($HOST, $DBUSER, $PASS) or die("Cannot connect to database server!"); $db = mysql_select_db($DATABASE, $connection) or die("Cannot select database!"); $sql = "SELECT nickname FROM users WHERE username = $ni"; $sql2 = "SELECT channel FROM users WHERE email = $ch"; [i][b]$result = mysql_query($sql) or die ("Can not check username. (DB ERROR)); $result2 = mysql_query($sql2) or die ("Can not check channel. (DB ERROR)");[/b][/i] $num = mysql_num_rows($result); $num2 = mysql_num_rows($result2); if ($num == 1) { echo "Error, user already exists!"; echo " <a href=\"signup.php\">Back to signup..</a>"; } elseif ($num2 == 1){ echo "Someone has already registered that channel."; echo " <a href=\"signup.php\">Back to signup..</a>"; } else { $query = "INSERT INTO users (nickname,channel,email,nickpassword,chanpassword,description) VALUES ('$_POST[nickname]','$_POST[channel]','$_POST[email]','$_POST[nickpassword]','$_POST[chanpassword]','$_POST[description]')"; $resultB = mysql_query($query,$connection) or die ("Coundn't execute query."); echo "Sucess! We have created your personal site.<br>"; When I go to the page, it returns: Can not check username. (DB ERROR) Like I said, the db has info in it.. Here's a PHPMyAdmin output of the database, and table 'users': Full Texts id nickname channel nickpassword chanpassword email description Edit Delete 1 fktest testroom4 testpass4 chanpass4 rpope904@comcast.net just a test room
  5. Thanks, that one got me.. it worked, thanks again.
  6. I am trying to write a php script, that writes a php file.. all is going good until line 180.. Here's the error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/rpope904/public_html/x10chat/signup_2.php on line 180 Here's the code: LINE 176> $stringData = "<param name=\"CABINETS\" value=\"irc.cab,securedirc.cab,pixx.cab\">\n"; LINE 177> fwrite ($fh, $stringData); LINE 178> $stringData = "<?\n"; LINE 179> fwrite ($fh, $stringData); LINE 180> $stringData = "$ni = $_POST[\'nickname\']; \n"; LINE 181> fwrite ($fh, $stringData); LINE 182> $stringData = "echo \"<param name=nick value=\".$ni.\"_xC\">\n"; LINE 183> fwrite ($fh, $stringData); LINE 184> $stringData = "?>\n"; Basically, what I need it to write to the file is: <? $ni = $_POST['nickname']; LINE 180 echo "<param name=nick value=".$ni."_xC>\n"; LINE 182 ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.