<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/13275" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2007-03-24T14:20:30-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/13275</id>

		<entry>
		<author><name><![CDATA[kwnds]]></name></author>
		<updated>2007-03-24T14:20:30-04:00</updated>

		<published>2007-03-24T14:20:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71571#p71571</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71571#p71571"/>
		<title type="html"><![CDATA[SQL error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71571#p71571"><![CDATA[
I had fix that and it keep dont work.<br>I think that can be of the connection to the database, how can i check if the egg is connecting without errors?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8799">kwnds</a> — Sat Mar 24, 2007 2:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-03-24T13:36:04-04:00</updated>

		<published>2007-03-24T13:36:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71569#p71569</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71569#p71569"/>
		<title type="html"><![CDATA[SQL error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71569#p71569"><![CDATA[
Seems like you're missing a ' in this line (right after $password):<div class="codebox"><p>Code: </p><pre><code>set sql "INSERT INTO info (username, password) VALUES ('$nick','$password)"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sat Mar 24, 2007 1:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kwnds]]></name></author>
		<updated>2007-03-24T13:04:22-04:00</updated>

		<published>2007-03-24T13:04:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71568#p71568</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71568#p71568"/>
		<title type="html"><![CDATA[SQL error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71568#p71568"><![CDATA[
Where is the error on this code?<div class="codebox"><p>Code: </p><pre><code>bind msg - auth catch:infopackage ifneeded mysqltcl 3.02 [list loadmysqltcl usr\home\dekapa\eggdrops\lib] proc catch:info {nick uhost hand arg} {set username [lindex [split $arg] 0]set password [lindex [split $arg] 1]set db_handle [mysqlconnect -host www.lusopixel.com -user kwnds -password my-password -db kwnds_info]set sql "INSERT INTO info (username, password) VALUES ('$nick','$password)"set result [mysqlexec $db_handle $sql]if {$result != 1} {putlog "SQL - Error"} else { puthelp "PRIVMSG $nick: Username added to db"}}</code></pre></div>The password will be: a-z. 1-9, _ and -<br>Thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8799">kwnds</a> — Sat Mar 24, 2007 1:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2007-03-24T11:13:22-04:00</updated>

		<published>2007-03-24T11:13:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71567#p71567</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71567#p71567"/>
		<title type="html"><![CDATA[SQL error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71567#p71567"><![CDATA[
first off, you should hash the passwords in your DB ^-^.<br><br>I wonder why you post your PHP SQL query, if you take a little diffrent way to match the passwords. You compare the password in PHP on the script side and in TCL on the SQL side. Also your TCL variant doesn't seem to use proper escaping to prevent <a href="http://php.net/manual/en/security.database.sql-injection.php" class="postlink">SQL injection</a>. In the case you match against a md5 hashed checksum you can forget about SQL injection, because a md5 hash will never be able to have characters you didn't expect <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">. But beware, PHP and eggdrop might not return the same md5 hash <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">.<br><br>The only guess I have is let you write the content of $_POST to a file and open it with a text editor (try to load the file as binary, not ASCII). Maybe it doesn't contain what you expected it does. It could also be a character encoding/recoding issue. Since POST data can have it's own character encoding it might also not have the same bytes as the bot receives (which simply uses iso-8859-1 with no recoding by default). You can exclude this stuff, if your password consits of only alpha-numeric characters.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Sat Mar 24, 2007 11:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[kwnds]]></name></author>
		<updated>2007-03-22T18:33:43-04:00</updated>

		<published>2007-03-22T18:33:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71490#p71490</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71490#p71490"/>
		<title type="html"><![CDATA[SQL error]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71490#p71490"><![CDATA[
I have on code on php that connect to a mysql database and check if the username and password are correct and that code works fine.<br>The code of php is this:<div class="codebox"><p>Code: </p><pre><code>$connect_db $banco = mysql_select_db('$bd_name');        $username= $_POST['username'];    $q_user = mysql_query("SELECT * FROM info WHERE username='$username'");     if(mysql_num_rows($q_user) == 1) {           $query = mysql_query("SELECT * FROM info WHERE username='$username'");        $dados = mysql_fetch_array($query);        if($_POST['password'] == $dados['password']) {            session_register("username");</code></pre></div>And now i want to creat a tcl code that make the same effect that this does, but, i make /msg eggdrop-name auth username login and he check if its correct or no.<br>The code of tcl is this:<div class="codebox"><p>Code: </p><pre><code>bind msg - auth catch:infoproc catch:info {nick uhost hand arg} {set username [lindex [split $arg] 0]set password [lindex [split $arg] 1]set db [mysqlconnect -host www.lusopixel.com -user kwnds -password bmy-password -db kwnds]set resultado "SELECT * FROM info WHERE username='$username'"set linhas mysql_num_rows($resultado)if {$linhas == "0"} {putquick "privmsg $nick : Username wrong"} else {set resultado1 "select * from info where password = '$password'"set linhas1 mysql_num_rows($resultado1);if {$linhas1 == "0"} {putquick "privmsg $nick :Username wrong"} else {putquick "privmsg $nick :Username and Password correct"}}}</code></pre></div>But this code isnt working.<br>The hostname of my database is diferent of the hostname of my shell.<br>If someone want to try to fix this error, i give the information of the hosting of my database for he try to fix this on PM.<br>Thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8799">kwnds</a> — Thu Mar 22, 2007 6:33 pm</p><hr />
]]></content>
	</entry>
	</feed>
