Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. Pass it through the url. eg; /gallery.php?id=12
  2. You cannot echo html within an image itself which is what sending the jpeg header does, makes this code an image.
  3. If (as your code suggests) both databases are on the same database server, you only need to make one connection. You then use mysql_select_db to switch between the two different servers. eg; <?php $handle = mysql_connect("localhost","myuser","apasswd"); mysql_select_db("db1",$handle); // code querying db1 mysql_select_db("db2",$handle); // more code that queries db2 mysql_select_db("db1",$handle); // again if need be, more code that queries db2
  4. Are you asking how to connect to multiple database servers? Make another call to mysql_connect() and store your connection in a different variable to $connection.
  5. Put this before your current code.... <?php ob_start(); ?> And this at the end..... <?php $data = ob_get_clean(); // $data now contains your output. Send email using mail.
  6. This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=313579.0
  7. I replied in your old thread saying that a simple wrapper around the $_POST array doesn't really *do* anything. You shouldn't just put everything into objects for the hell of it, objects need to do something useful / provide some functionality. The code you have posted, while wrapping a specific set of data sent via a POST request, doesn't give you any benefit, and in fact would need to be edited if ever you wanted your user to be able to submit there age for example. OOP is not about editing your objects every time you need to make a change. I would be more inclined to develop a Request object. This Request object would wrap around *all* data contained within the users request. This is generally what most frameworks do and while it alone doesn't really provide any extra functionality or benefit, it does now mean that all your request data will be within one object instead of a series of arrays ($_POST, $_GET, $_REQUEST, $_SERVER etc etc). However, I'm still not real sure what exactly your trying to do. As I said earlier, putting everything in classes does not necessarily mean its OOP and OOP is not simply jamming everything in classes for the fun of it.
  8. You would firstly need to modify your code within search.php so that your queries work with names, not id's. eg, get this url working.... example.co.uk/search?region=marbella&type=villas From there, you put a simple rewrite rule in place within your .htaccess file. RewriteRule ^/([^/]+)/([^/]+) /search?$1=$2
  9. This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=313540.0
  10. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=313548.0
  11. class $connection{ Should give you an error. class connection { is valid.
  12. This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=313491.0
  13. You will need to show us some code I think. I'm still not really sure what exactly your doing from your description alone.
  14. This topic has been moved to Editor Help (Dreamweaver, Zend, etc). http://www.phpfreaks.com/forums/index.php?topic=313507.0
  15. $sql = "SELECT * FROM orig_codes_1a"; $result = mysql_query($sql) or die(mysql_error()); // END :: Create query to be displayed as final results of original codes table. echo "<p>$sql</p>";
  16. Use... if (isset($_POST['checkbox'])) { Instead of.... if (isset($_POST['submit'])) {
  17. The variable ($checkbox) used in your foreach isn't defined anywhere is the first thing I see.
  18. Ah, yeah, that'll be your problem. Your using $dbh, (which is a connection object) as the table name in your query (which should be a string).
  19. else $skipped = "Account Skipped: wrong password/email combo, or a login error...\n"; echo $skipped; $echo = file_put_contents($filename, $skipped, FILE_APPEND);
  20. if ($result = mysql_query("SELECT Banned FROM users WHERE username = '$username'")) {
  21. zip_open() expects a string. $zip = zip_open('myzip.zip');
  22. Does.... echo '<a href="zenphoto/index.php?album=' . str_replace('-s', '-w', $_GET['album']) . '">link name</a>'; help you?
×
×
  • 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.