farsiscript 0 Report post Posted April 27, 2006 hi all i write this code to write in mysql form this form but its not work plz help me to fix erre : <?php $username = "user1"; //sina Jan Inja Username $password = "pass1"; //Sina Jan Inja Password $randomword = "ArashHosseinian"; if (isset($_COOKIE['MyLoginPage'])) { if ($_COOKIE['MyLoginPage'] == md5($password.$randomword)) { ?><?php $db_host = "localhost"; $db_user = "root"; $db_pwd = ""; $db_name = "music"; mysql_connect($db_host, $db_user, $db_pwd); mysql_select_db($db_name);?> <html> <head> <title>Admin Panel</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> </head> <body> <?php if (!isset($_POST['submit'])) { ?> <div align="center"> <table cellpadding="0" cellspacing="0" width="659" id="table1" height="415"> <!-- MSTableType="layout" --> <tr> <td height="415" width="659" valign="top"> <form name="sql" method="POST" action=""> <!--webbot bot="SaveResults" U-File="../_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" --> <div align="right"> <table cellpadding="0" cellspacing="0" width="656" height="337" id="table2"> <!-- MSTableType="layout" --> <tr> <td valign="middle" align="right"> <input type="text" onkeypress='return farsikey(this,event)' onkeydown='changelang(this);' name="text1" size="20" dir="rtl" style="font-family: Tahoma; font-size: 8pt; color: #FF6600; border: 1px dotted #FFFFFF; background-color: #000000"></td> <td valign="middle" align="right"> <p align="right" dir="rtl"> <span lang="fa"> <font face="Tahoma" style="font-size: 8pt" color="#8ECA23"> نام آهنگ شماره 1</font></span></td> <td valign="top"> <p align="right"> <input type="text" onkeypress='return farsikey(this,event)' onkeydown='changelang(this);' name="album" size="20" dir="rtl" style="font-family: Tahoma; font-size: 8pt; color: #FF6600; border: 1px dotted #FFFFFF; background-color: #151515"></td> <td valign="middle" height="21"> <p align="right" dir="rtl"> <font face="Tahoma" style="font-size: 8pt" color="#FFFFFF"> <span lang="fa">نام آلبوم</span></font></td> </tr> <tr> <td valign="middle" align="right"> <input type="text" name="link1" size="20" dir="ltr" style="font-family: Tahoma; font-size: 8pt; color: #FF6600; border: 1px dotted #FFFFFF; background-color: #000000"></td> <td valign="middle" align="right"> <p align="right" dir="rtl"> <font face="Tahoma" style="font-size: 8pt" color="#FFFFFF"> <span lang="fa">آدرس آهنگ شماره 1 (با </span>http<span lang="fa">)</span></font></td> <td valign="top"> <p align="right"> <input type="text" onkeypress='return farsikey(this,event)' onkeydown='changelang(this);' name="artist" size="20" dir="rtl" style="font-family: Tahoma; font-size: 8pt; color: #FF6600; border: 1px dotted #FFFFFF; background-color: #000000"></td> <td valign="middle" height="21"> <p align="right" dir="rtl"> <span lang="fa"> <font face="Tahoma" style="font-size: 8pt" color="#FFFFFF"> نام خواننده (فارسی)</font></span></td> </tr> <tr> <td valign="middle" align="right"> <input type="text" onkeypress='return farsikey(this,event)' onkeydown='changelang(this);' name="text2" size="20" dir="rtl" style="font-family: Tahoma; font-size: 8pt; color: #FF6600; border: 1px dotted #FFFFFF; background-color: #000000"></td> <td valign="middle" align="right"> <p align="right" dir="rtl"> <span lang="fa"> <font face="Tahoma" style="font-size: 8pt" color="#8ECA23"> نام آهنگ شماره 2</font></span></td> <td valign="top"> <p align="right"> <input type="text" name="date" size="20" dir="ltr" style="font-family: Tahoma; font-size: 8pt; color: #FF6600; border: 1px dotted #FFFFFF; background-color: #000000"></td> <td valign="middle" height="21"> <p align="right" dir="rtl"> <span lang="fa"> <font face="Tahoma" style="font-size: 8pt" color="#FFFFFF"> تاریخ ارسال به بازار</font></span></td> </tr> <tr> <td valign="middle" align="right"> <input type="text" name="link2" size="20" dir="ltr" style="font-family: Tahoma; font-size: 8pt; color: #FF6600; border: 1px dotted #FFFFFF; background-color: #000000"></td> <td valign="middle" align="right"> <p align="right" dir="rtl"> <font face="Tahoma" style="font-size: 8pt" color="#FFFFFF"> <span lang="fa">آدرس آهنگ شماره 2 (با </span>http<span lang="fa">)</span></font></td> <td valign="top"> <p align="right"> <input type="text" name="img" size="20" dir="ltr" style="font-family: Tahoma; font-size: 8pt; color: #FF6600; border: 1px dotted #FFFFFF; background-color: #000000"></td> <td valign="middle" height="21"> <p align="right" dir="rtl"> <font face="Tahoma" style="font-size: 8pt" color="#FFFFFF"> <span lang="fa">آدرس عکس آلبوم (همراه </span>http<span lang="fa">)</span></font></td> </tr> <tr> <td valign="middle" align="right"> <input type="text" onkeypress='return farsikey(this,event)' onkeydown='changelang(this);' name="text3" size="20" dir="rtl" style="font-family: Tahoma; font-size: 8pt; color: #FF6600; border: 1px dotted #FFFFFF; background-color: #000000"></td> <td valign="middle" align="right"> <p align="right" dir="rtl"> <span lang="fa"> <font face="Tahoma" style="font-size: 8pt" color="#8ECA23"> نام آهنگ شماره 3</font></span></td> <td valign="top"> <p align="right"> <select size="1" name="coun" dir="rtl" style="font-family: Tahoma; font-size: 8pt; color: #FF6600; border: 1px solid #FFFFFF; background-color: #000000"> <option value="ir">ایران </option> <option value="tu">ترک </option> <option value="ar">عربی </option> <option value="ot">خارجی </option> </select></td> <td valign="middle" height="21"> <p align="right" dir="rtl"> <span lang="fa"> <font face="Tahoma" style="font-size: 8pt" color="#FFFFFF"> کشور</font></span></td> </tr> <tr> <td valign="middle" align="right"> <input type="text" name="link3" size="20" style="font-family: Tahoma; font-size: 8pt; color: #FF6600; border: 1px dotted #FFFFFF; background-color: #000000"></td> <td valign="middle" align="right"> <p align="right" dir="rtl"> <font face="Tahoma" style="font-size: 8pt" color="#FFFFFF"> <span lang="fa">آدرس آهنگ شماره 3 (با </span>http<span lang="fa">)</span></font></td> <td valign="top"> <p align="right"> <select size="1" name="artistabc" dir="rtl" style="font-family: Tahoma; font-size: 8pt; color: #FF6600; border: 1px dotted #FFFFFF; background-color: #000000"> <option>A</option> <option>B</option> <option>C</option> <option>D</option> <option>E</option> <option>F</option> <option>G</option> <option>H</option> <option>I</option> <option>J</option> <option>K</option> <option>L</option> <option>M</option> <option>N</option> <option>O</option> <option>P</option> <option>Q</option> <option>R</option> <option>S</option> <option>T</option> <option>U</option> <option>V</option> <option>W</option> <option>X</option> <option>Y</option> <option>Z</option> </select></td> <td valign="top" height="21"> <p align="right" dir="rtl"> <span lang="fa"> <font face="Tahoma" style="font-size: 8pt" color="#FFFFFF"> نام اول خواننده (انگلیسی)</font></span></td> </tr> <tr> <td valign="middle" align="right"> <input type="text" onkeypress='return farsikey(this,event)' onkeydown='changelang(this);' name="text4" size="20" dir="rtl" style="font-family: Tahoma; font-size: 8pt; color: #FF6600; border: 1px dotted #FFFFFF; background-color: #000000"></td> <td valign="middle" align="right"> <p align="right" dir="rtl"> <span lang="fa"> <font face="Tahoma" style="font-size: 8pt" color="#8ECA23"> نام آهنگ شماره 4</font></span></td> <td valign="top"> <p align="right"> <select size="1" name="cat" dir="rtl" style="font-family: Tahoma; font-size: 8pt; color: #FF6600; border-style: dotted; border-width: 1px; background-color: #000000"> <option value="5">بی کلام </option> <option value="9">سنتی </option> <option value="10">راک </option> <option value="6">پاپ </option> Share this post Link to post Share on other sites
WindAndWater 0 Report post Posted April 27, 2006 Could you please post again, telling us the error message you're getting and what line it's on? If you aren't getting an error message, explain what the unexpected behavior is. Also, a slight digression, but using a MD5 hash is extrodinarily unsafe. I'd suggest switching it to SHA1, although SHA1's not all that much better. (I'm really waiting for PHP to officially support a SHA2 function). Share this post Link to post Share on other sites