Jump to content

Dekken

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Dekken's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Come on guys, Please just give me few minutes, and test this script by yourself
  2. Really? no one used this one before? can anyone please download the script, and do some testings? I have been stuck on this problem for few days now...
  3. Hello, I have a problem with this script: http://sourceforge.net/projects/phpsmartirc/ Piece of code I am having problem with: http://nopaste.php-quake.net/333811 Basically it is supposed to send the $irc->message first, and then open the socket. But what happens is that the socket opens, and only when it closes, it sends the message. And that is a problem because the socket stays open for around 30-40minutes. If I am trying to use echo instead of $irc->message, it works just fine. So seems like there is some kind of a delay in it. Can anyone help me find a solution for this problem? Thanks!
  4. Thanks for the Reply but my spacing problem is not fixed... if you want you can take a look... my sisters site >_> http://mathmatic.info/index.php everytime you refresh it just adds another row...and another one and another one thats my code right now. <?php $save_file = $_POST['save_file']; $TestDate = $_POST['CurrentDate']; $con = mysql_connect("XXXXXX","XXXXXX","XXXXXXXX"); if (!$con) { die('Could not connect: ' . mysql_error()); } //Create the Database mysql_select_db("XXXX", $con); $sql = "CREATE TABLE Thenews ( personID int NOT NULL AUTO_INCREMENT, PRIMARY KEY(personID), Datenow varchar(30), Coursenow varchar(30), Messagenow varchar(255) )"; mysql_query($sql, $con); if(!$sql) { echo mysql_error(); } mysql_select_db("XXXXX", $con); $sql="INSERT INTO Thenews (Datenow, Coursenow, Messagenow) VALUES ('$_POST[CurrentDate]','$_POST[CourseName]','$_POST[MessgeContent]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } mysql_select_db("XXXX", $con); $result = mysql_query("SELECT * FROM Thenews"); echo "<center>"; echo "<table border=1 dir=rtl>"; echo "<tr>"; echo "<th>DATE</th>"; echo "<th>COURSE</th>"; echo "<th>MESSAGE</th>"; echo "</tr>"; // THE ISSUE IS PROBABLY HERE while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td width=100 valign=top valign=top><font size=1>" . nl2br($row['Datenow']) . "</font></td>"; echo "<td valign=top width=70><font size=2>" . $row['Coursenow'] . "</font></td>"; echo "<td width=600><font size=2><b><i>" . nl2br($row['Messagenow']) . "</i></b></font></td>"; echo "</tr>"; } // THE ISSUE IS PROBABLY HERE echo "</table>"; echo "</center>"; echo mysql_error(); mysql_close($con); ?>
  5. Anyone? maybe adding if statement or something? iam clueless and i really need a way to fix it Sorry for the double :-\
  6. Thanks! works like a charm and for my last issue...i noticed that i makes spaces in the Table whenever you Refresh the page... well i know why it happens but i dont know how to fix it any help?
  7. Hey guys! well i know really basics in MYSql and PHP but iam still trying to make something that will allow me to Post New messages Thats my code so far: Php File: <?php $con = mysql_connect("localhost","XXXXXX",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("dekken2_uk_db", $con); $sql="INSERT INTO Thenews (Datenow, Coursenow, Messagenow) VALUES ('$_POST[firstname]','$_POST[lastname]','$_POST[age]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } mysql_select_db("dekken2_uk_db", $con); $result = mysql_query("SELECT * FROM Thenews"); echo "<center>"; echo "<table border='1' dir=rtl> <tr> <th>Date</th> <th>Course</th> <th>Message</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['Datenow'] . "</td>"; echo "<td>" . $row['Coursenow'] . "</td>"; echo "<td>" . $row['Messagenow'] . "</td>"; echo "</tr>"; } echo "</table>"; echo "</center>"; mysql_close($con); ?> Index.html: <html> <body> <form action="test2.php" method="post"> Date: <input type="text" name="firstname" /> <br> Course: <input type="text" name="lastname" /> <br> Message: <textarea name="age" dir=rtl width=40 height=40></textarea> <input type="submit" /> <br> </form> </body> </html> so i have 2Issues now. How do i clear all the Data inside the Tables and the Columns? lets say i have Table called Test and i have Column called iCheck in it. and in iCheck i have lots of Info. How do i clear the info in iChecks without Deleting the Column and the Table itself? Second one is, How do i fix my table issue? Sometimes whenever i post a new message there is lots of Spaces and Gaps in the table Example: http://img80.imageshack.us/my.php?image=problemtm1.jpg And also how do i make it so whenever i go down a line using enter(not sure how its called..Space? uh dunno) in the Textarea, it will go down a line in the Table..instead of 1Long line
  8. GRRR cant edit pots? oh well... Nvm, ill just learn some mysql...will be much easier i guess. Thanks
  9. Thanks! i got the tables sorted out now the problem i have is how do i make it Read the words Between the Brackets? if i have something like this: [CloseDate] Test. Test 2 Test 3 [CloseDate] It wont show up anything...just an empty table Thats my code: <html> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1255"> <title></title> </head> <?php $save_file = $_POST['save_file']; $savecontent1 = $_POST['savecontent1']; $savecontent2 = $_POST['savecontent2']; $savecontent3 = $_POST['savecontent3']; $loadcontent = "file_name.txt"; if($save_file) { $savecontent1 = stripslashes('[CloseDate]' . $savecontent1 . '[CloseDate]' . "\n"); $savecontent2 = stripslashes('[CloseKurs]' . $savecontent2 . '[CloseKurs]' . "\n"); $savecontent3 = stripslashes('[CloseSubject]' . $savecontent3 . '[CloseSubject]' . "\n"); $fp = @fopen($loadcontent, "a"); if ($fp) { fputs($fp,$savecontent1."\r\n"); fputs($fp,$savecontent2."\r\n"); fputs($fp,$savecontent3."\r\n"); fclose($fp); } } $fp = @fopen($loadcontent, "a+"); $loadcontent = fread($fp, filesize($loadcontent)); $loadcontent = htmlspecialchars($loadcontent); fclose($fp); ?> <center> <form method=post action="<?=$_SERVER['PHP_SELF']?>"> <b> Date:</b> <br> <input type=text name="savecontent1"> <br> <br> <b> Kurs:</b> <br> <input type=text name="savecontent2"> <br> <br> <b> Subject:</b> <br> <textarea name="savecontent3" cols="70" rows="25" dir=rtl></textarea> <!-- <?=$loadcontent?> --> <br> <input type="submit" name="save_file" value="Save"> </form> </center> </html> probably have lots of mistakes here...but oh well Thanks
  10. i looked a bit into it, ill consider it whenever i get some free time but the XML still doesnt help me with the Tables thingy... how could i make the tables show up correctly? =\
  11. its not that important...i am just Inserting data into the text file using <textarea>... but here it is [CloseKurs]KURS[CloseKurs] [CloseSubject]SUBJECT[CloseSubject] [CloseDate]DATE[CloseDate] [CloseKurs]KURS[CloseKurs] [CloseSubject]MESSAGE[CloseSubject] [CloseDate]DATE[CloseDate] the CloseDate and CloseSubject etc is the only way i tho of, about how to insert data into tables...identify which line is which :-\
  12. Hey! started learning PHP yesterday...so i took on myself small project for my sister News board i guess? some kind of? Iam trying to make a Text file show up in a Table, but i cant seem to make it. <html> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1255"> <title></title> </head> <?php $fileName = 'file_name.txt'; $fileBody = file_get_contents($fileName); //Date if (preg_match_all('/\[CloseDate](.*?)\[CloseDate]/', $fileBody, $matches)) { $words = $matches[1]; for ($i = 0; $i < count($words); $i++) { echo $words[$i]; } } //Kurs if (preg_match_all('/\[CloseKurs](.*?)\[CloseKurs]/', $fileBody, $matches)) { $words = $matches[1]; for ($i = 0; $i < count($words); $i++) { echo $words[$i]; } } // Subject if (preg_match_all('/\[CloseSubject](.*?)\[CloseSubject]/', $fileBody, $matches)) { $words = $matches[1]; for ($i = 0; $i < count($words); $i++) { echo $words[$i]; } } ?> </html> basically i want it to look like this: but whatever i tried got screwed up and messed up! also is there more efficient way of doing this? Thanks!!
×
×
  • 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.