Jump to content

Pastulio

Members
  • Posts

    85
  • Joined

  • Last visited

    Never

Everything posted by Pastulio

  1. well you have to close your tags... and add a </font> behind by and so on then change the color codes on each part
  2. you forgot a space after your "by" and don't forget to click "topic solved" when you're done
  3. well by using this which I previously posted: <style type="text/css"> <!-- .shout{ padding-bottom:4px; border-bottom:1px solid #000; width:180px; text-align:left; font-family:Arial font-size:11px; background-color:#262727 font-color:#FFFFFF } --> </style> all of the text will be white
  4. well you can't just make the "by" alone white by my edit, to do that I'd to this: echo "<div class='shout'> Shouted on: <i>".$time."</i><br> <font color=#FFFFFF>By</font> <b><a href='mailto:".$mail."'>".$name."</b></a><br> ".$message."<br> </div><br>"; btw this is in shout.php
  5. If they've already broken into your database, they're not gonna have much use getting a password
  6. <style type="text/css"> <!-- .shout{ padding-bottom:4px; border-bottom:1px solid #000; width:180px; text-align:left; font-family:Arial font-size:11px; background-color:#262727 font-color:#FFFFFF } --> </style>
  7. Ok didn't know that since I don't have 10 000 users, I'll change it now, thanks.
  8. <style type="text/css"> <!-- .shout{ padding-bottom:4px; border-bottom:1px solid #000; width:180px; text-align:left; font-family:Arial font-size:11px; background-color:#262727 font-color:$FF0000 } --> </style> by editing that you can change about everything about it
  9. yes, so just add your HTML (the layout of the shoutbox as I can see is set in CSS at the top)
  10. <?php $result = mysql_query("select * from shoutbox order by id desc limit 5"); ?> if you increase the number behind "limit" the shoutbox will be longer, and to make it look like your website, edit the HTML and CSS.
  11. <?php $query_msg = "SELECT * FROM `pms` WHERE `reciever_id`='$id' AND `read_flag` = 'N'"; $result_msg = mysql_query($query_msg) or die (mysql_error()); $num_rows = mysql_num_rows ($result_msg); if ($num_rows == 1){ echo "you have 1 new message."; } elseif ($num_rows > 1) { echo "you have " . $num_rows . " new messages."; } ?> I think this will do.
  12. Ok, so I have a class to connect to a database (and it would be done much easier as just two functions). here is the script: connect_db.php <?php /* +---------------------------------------------------+ | | | PHP MySQL database connection class | | | +---------------------------------------------------+ | Filename : connect_db.php | | Created : 25/06/2007 20:29 | | Created By : Pascal Van Acker (a.k.a Pastulio) | | Email : | | Version : 1.0 | | | +---------------------------------------------------+ */ class db_connect { // MySQL Config var $db_host; // MySQL host (usually 'localhost') var $db_username; // MySQL username var $db_password; // MySQL password var $db_name; // MySQL database name var $db_connection; // MySQL database connection variable var $db_select; // MySQL database selection variable function db_Connect () { // Connect to the MySQL server $this -> db_connection = mysql_connect ($this -> db_host, $this -> db_username, $this -> db_password); // Test the MySQL connection if (!$this -> db_connection) { return false; } else { return true; } } // END db_Connect function db_Select () { $this -> db_select = mysql_select_db ($this -> database, $this -> db_connection); // Test the MySQL selection if (!$this -> db_select) { return false; } else { return true; } } } /* THE CODE TO INCLUDE IN THE FILE WHERE YOU NEED TO CALL THE DATABASE CREATION $create_db = new db_connect (); // Call the class $create_db -> db_host = ''; // Set the MySQL host $create_db -> db_username = ''; // Set the MySQL username $create_db -> db_password = ''; // Set the MySQL password $create_db -> database_name = ''; // Set the MySQL to be created database name $create_db -> db_Connect (); $create_db -> db_Select (); */ ?> But I want other classes to be able to use that function to do that. Here is another class in which I need it: create_db.php <?php /* +---------------------------------------------------+ | | | PHP MySQL database creation class | | | +---------------------------------------------------+ | Filename : create_db.php | | Created : 25/06/2007 20:29 | | Created By : Pascal Van Acker (a.k.a Pastulio) | | Email : | | Version : 1.0 | | | +---------------------------------------------------+ */ class create_database { // MySQL config var $database_name; // MySQL database name function check_Existence () { $result = mysql_list_dbs ($this -> connection); while ($list = mysql_fetch_array($result)) { $database_list[] = $list['database']; } if (!in_array($this -> database_name, $database_list)) { return true; } else { return false; } } function db_Create () { $query = "CREATE DATABASE `" . $this -> database_name . "`"; $result = mysql_query ($query); if (!$result) { return false; } else { return true; } } // END db_Create function create () { if ($this -> db_Connect ()){ if ($this -> check_Existence ()){ if ($this -> db_Create ()){ return true; } } } } } /* THE CODE TO INCLUDE IN THE FILE WHERE YOU NEED TO CALL THE DATABASE CREATION $create_db = new create_database (); // Call the class $create_db -> database_name = ''; // Set the MySQL to be created database name $create_db -> create(); */ ?> Now can anybody help me on how to do this or should I just call the connect_db class in the pages I need manually? (in which case I will just make the class into 2 functions) Thanks a lot, Pastulio
  13. The reason for doing this is because it is the most safe way of Advanced SQL injection that you can use in my opinion, but the function works fine too. But thanks
  14. Ok I've edited it and Found out that I named the create_database function the same as the function, which would make it a constructor and run that first. I've changed it and it works but the 2nd error is still there This is line 30 $this -> $connection = mysql_connect ($this -> db_host, $this -> db_username, $this -> db_password); Any help would be greatly appreciated This is line 30
  15. www.12gbfree.com I didn't know which version they ran but it's PHP Version 5.1.6 so what you need.
  16. For testing scripts I would advise you to get WAMPserver instead of a host it is available on http://www.wampserver.com/en This program will install PHP, MySQL, PHPmyadmin, etc... on your local machine and you can test scripts locally
  17. Maybe you are not connected to the database, or the right one or something? Because it should always find a valid result if the table exists, even if there are no rows in it. So do a routine check for any typo's or other bugs. Because, when PHP shows an error on a line, your problem could also lie in a different portion of your code
  18. Then I don't know but what I do know is, that you shouldn't be using a while loop because you'll have only one result anyway (well that's what your code looks like), so you could just make it like this $query = "SELECT * FROM `CustomisationClothing` WHERE `name`='$name'"; $result = mysql_query($query); $row = mysql_fetch_array ($result); I don't know why but when I code it like that it always works for me, unless the table you are looking for does not exist.
  19. I don't know sorry, but you can manually delete other files you know are in there I guess.
  20. scandir — List files and directories inside the specified path
  21. chdir — Change directory chroot — Change the root directory dir — Directory class closedir — Close directory handle getcwd — Gets the current working directory opendir — Open directory handle readdir — Read entry from directory handle rewinddir — Rewind directory handle scandir — List files and directories inside the specified path And then you can use in_array on your error.
  22. in dos it's just "dir" but lemme check if it's the same in PHP
  23. all I can think of is a syntax error $editclothing = mysql_query("SELECT * FROM CustomisationClothing WHERE name='$name'"); should be: $editclothing = mysql_query("SELECT * FROM `CustomisationClothing` WHERE `name`='$name'");
  24. I tried making a function that does both, no succes <?php function format_text ($text){ $text = nl2br ($text); $text = str_replace ('\n', '<br />', $text); return $text; } format_text ($comment['Comment']); ?>
×
×
  • 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.