Jump to content

HuggieBear

Members
  • Posts

    1,899
  • Joined

  • Last visited

Everything posted by HuggieBear

  1. Try changing it to this... <!-- EDIT BELOW THIS LINE --> <table align="center"> <tr>'; $data = ssi_recentPosts(); $content .= $data; $content .= '<tr> </table> <!-- EDIT ABOVE THIS LINE --> '; $content .= '</div>'; Regards Huggie
  2. If you're using it in a preg_replace() function then you probably want to use file_get_contents()... <?php $mpu = file_get_contents('mputag.php'); ?> <body> <?php $len = (strlen($story) >> 1); echo preg_replace( "/(?<=.{{$len}})\s/s", "<br /><br />".$mpu."<br /><br />", nl2br($story), 1); ?> </body> I don't know how it'll cope with the nested <?php tags Regards Huggie
  3. I don't think you have to worry about it too much Regards Huggie
  4. By assigning the result of include('mputag.php') to $mpu, you're giving it a value of either true or false (1 or 0) hence the display of the number 1. I'm guessing include isn't actually the function you want. What does this mputag.php file contain and what are you trying to display? Regards Huggie
  5. Nope, you're an expert now ;-) Try some of the tutorials here @ PHPFreaks Regards Huggie
  6. You could base in on file extension... <?php // Check the extension is valid if (preg_match('/\.(jpg|jpeg|gif|png)$/i', $_FILES['uploadFile'. $x]['name']){ // Add your adding to db and moving code here } else { // Add your error code here echo "Sorry, file must be of type .jpg .jpeg .gif or .png\n"; } ?> Or there's a slightly more complex method using mime type. Search these forums for that. Regards Huggie
  7. My guess would be that one of the other fields in the database (other than the id column) is also set to be unique. Regards Huggie
  8. Look at imagecreatefromstring() regards Huggie
  9. Replace this in your code $copy = copy($_FILES['uploadFile'. $x]['tmp_name'],$file_name); With this in my code // Set pth to image directory $path = '../images/'; // Move file to new location move_uploaded_file($_FILES['uploadFile'. $x]['tmp_name'], $path . $file_name) It should be that simple. Regards Huggie Edit: I notice you're not stripping the path from the temp name, you'll want to do that too.
  10. Firstly add a forward slash to the end of that path, so it reads $path = '../images/'; Regards Huggie
  11. OK, think about this logically... 1. Present the user with a login form 2. Check the user against the database 3. If the user is verified then create a session variable with their unique User ID in it, if not then re-present the login form 4. Add a check to the top of each member page to make sure that the session variable exists. If it doesn't redirect to login page, if it does then display content. That's as simple as it gets for logging in. Worry about making functions out of it afterwards, especially if you're struggling with the basic procedural approach. Regards Huggie
  12. Hmmm, don't Server Side Includes use a syntax like this: <!--#include virtual="../file.php" --> But if you're using PHP there shouldn't be a real need to use SSI. Regards Huggie
  13. Also make sure you use something like mysql_escape_string() on your data before selecting it. Regards Huggie
  14. Try inserting the 'From:' header. I know Hotmail doesn't like it if it's not included. Regards Huggie
  15. Change your SQL statement to this... $sql = "SELECT `" . $select . "` FROM `cf_users` WHERE `id` = '" . $where . "' LIMIT 1"; Escaping out of the quoted string to insert your variables makes it a) easier to read and b) quicker to parse. Regards Huggie
  16. You're seeing the sql, as that's what you're echoing. If you want the results displayed then you need to echo them... <?php // SQL query for all entries in descending order (Added a limit clause here as I assume you're only expecting 1 result) $sql = "SELECT '$select' FROM `cf_users` WHERE `id`='$where' LIMIT 1"; // Return a result resource (this still isn't in a form you can echo) $rs = mysql_query( $sql ) or die('Query:<br />' . $sql . '<br /><br />Error:<br />' . mysql_error()); // This is missing, this gets the actual data from the result resource $username = mysql_result($rs,0,0); /* This is changed echo $sql; to this */ echo $username; ?> Regards Huggie
  17. That will be due to these lines... $sql = "SELECT '$select' FROM `cf_users` WHERE `id`='$where'"; echo $sql; Notice anything wrong Regards Huggie
  18. I stand corrected... Take a look at StatCounter. They use javascript to log the details. Once you've signed up, they'll give you the code to insert into your page, open the javascript link they send you and see what it contains. Regards Huggie
  19. I don't have rewrite on, so you'll have to use the following image tag... <img src="http://dizzie.co.uk/tracker/image.php"> Place it on your page and see what happens when you refresh the page a few times. Then access the following url... http://dizzie.co.uk/tracker/stats.php Regards Huggie
  20. I see what you're after now and you don't need to do anything special. It should work fine. I've just tested it and it works a treat. Want me to provide you a simple example? Regards Huggie
  21. That could easily (and most likely) be a single string containing newline characters as opposed to an array containing 4 lines. Regards Huggie
  22. Is the original source of $companyaddress an array in the first place? Try this and paste the outcome (in code tags). var_dump($companyaddress); Regards Huggie
  23. That's what I gave you... 7.16.2 I never mentioned the latest version. Regards Huggie
×
×
  • 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.