Jump to content

HuggieBear

Members
  • Posts

    1,899
  • Joined

  • Last visited

Everything posted by HuggieBear

  1. Place the button inside a form and have the form action set to the php script... <form name="myForm" action="delete.php" method="POST"> <input type="button" name="delete" value="Delete"> </form> Regards Huggie
  2. That's because your ob_start() is in the wrong place, it needs to be before anything gets output, not just before the header. Line 8 of your index.php is outputting code before all this. ob_start() needs to before that. Regards Huggie
  3. Well the following url will give you a map from the latitude and longitude, all you need to do now is get the former from the IP address: Mapquest Regards Huggie
  4. Can I suggest a more simple solution? It will require you to change your html form very slightly, can you do that? Regards Huggie
  5. I don't know if you wrote these posts in a rush, but I have NO idea as to what you're trying to achive and what you're actually asking. Regards Huggie
  6. You can't just put ob_start() and ob_end_flush() around the header that you want to output, it doesn't work like that. You have to put it around all the content ouput until that point. I may have confused you with Output Buffering before you were ready for it. Read this tutorial, it's short, aimed at beginners and should really help you. Regards Huggie
  7. You need to indent your code to make it more readable. You're missing a closing curly bracket. It's easier to see when indented correctly. Try this... <?php //This is the directory where images will be saved $path = '../images/'; //This gets all the other information from the form $name=$_POST['name']; $suburb=$_POST['suburb']; $price=$_POST['price']; $content=$_POST['content']; $uploadFile0=($_FILES['uploadFile0']['name']); $uploadFile1=($_FILES['uploadFile1']['name']); $uploadFile2=($_FILES['uploadFile2']['name']); $uploadFile3=($_FILES['uploadFile3']['name']); $uploadFile4=($_FILES['uploadFile4']['name']); $uploadFile5=($_FILES['uploadFile5']['name']); $uploadFile6=($_FILES['uploadFile6']['name']); $uploadFile7=($_FILES['uploadFile7']['name']); $uploadFile8=($_FILES['uploadFile8']['name']); // Connects to your Database mysql_connect("localhost", "root", "5050888202") or die(mysql_error()) ; mysql_select_db("gcproperty") or die(mysql_error()) ; // Check the extension is valid if (preg_match('/\.(jpg|jpeg|gif|png)$/i', $_FILES['uploadFile'. $x]['name'])){ //Writes the information to the database mysql_query("INSERT INTO `employees` VALUES ('$name', '$suburb', '$price', '$content', '$uploadFile0', '$uploadFile1', '$uploadFile2', '$uploadFile3', '$uploadFile4', '$uploadFile5', '$uploadFile6', '$uploadFile7', '$uploadFile8')") ; $uploadNeed = $_POST['uploadNeed']; // start for loop for($x=0;$x<$uploadNeed;$x++){ $file_name = $_FILES['uploadFile'. $x]['name']; // strip file_name of slashes $file_name = stripslashes($file_name); $file_name = str_replace("'","",$file_name); $copy = move_uploaded_file($_FILES['uploadFile'. $x]['tmp_name'], $path . $file_name); } } else { // Add your error code here echo "Sorry, file must be of type .jpg .jpeg .gif or .png\n"; } // check if successfully copied if($copy){ print "<meta http-equiv=\"refresh\" content=\"0;URL=property_added_successfully.php\">"; } else{ echo "$file_name | could not be uploaded!<br>"; }// end of loop ?> Regards Huggie
  8. I looked at the Zen Cart site and dowloaded the latest version of Blank Sidebox (for Zen Cart v1.3.7) and then visited the SMF site to look at their SSI stuff. I came up with the following: <?php /** * blank sidebox - allows a blank sidebox to be added to your site * * @package templateSystem * @copyright 2007 Kuroi Web Design * @copyright Portions Copyright 2003-2007 Zen Cart Development Team * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: blank_sidebox.php 2007-05-26 kuroi $ */ /* Looking at both the Zen Cart homepage and the SMF homepage I think the following should probably work. */ // Needs to be the full path to the SMF SSI.php require('/path/to/smf/forum/SSI.php'); $content = ''; $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">'; // Replace the text and HTML tags between the apostophes on lines 19 and 20. // Use as many or as few lines using this model as you need for your custom content. // If you have a multilingual site define your text in the languages/YOUR_LANGUAGE/extra_definitions/blank_sidebox_defines.php and include it as shown in line 19. // If your site is monolingual, you can put the text right here as shown on line 20 (and nobody will know!) $content .= '<p>' . ssi_recentPosts() . '</p>'; $content .= '</div>'; ?> I think the most important part to note here is probably the require of SSI.php on your page. If you're running version 1.3.0 of Zen Cart then you should still be able to use what I've posted. Regards Huggie
  9. Take a look at Regular Expression Syntax in the manual first, as there's a section that displays the meta-characters which may answer a lot of your questions. Regular Expression Syntax is really useful to know as it's excellent for writing search routines and is used in a lot of languages, there aren't many differences between language when it comes to RegEx's Regards Huggie
  10. Before we go any further with permissions, is your server running Windows or Unix/Linux flavoured box? Regards Huggie
  11. Something like this should work... <?php // Set query $sql = "SELECT * FROM test_table"; // Execute it $result = mysql_query($sql); // Loop through the results while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { // Echo them out echo "<a href='update.php?id=" . $row['id'] . "'>" . $row['First_Name'] . " " . $row['Last_Name'] . "</a><br>\n"; } ?> Regards Huggie
  12. The following works... <?php // Set the URL $url = 'http://www.bungie.net/Stats/Halo3/Default.aspx?player=sports209'; // Get the entire page contents $page = file_get_contents($url); // Match the image source preg_match('/class="model".*?src="([^\"]+)/', $page, $matches); $image_source = $matches[1]; // Echo the source echo $image_source; ?> Regards Huggie
  13. This should be very easy as the developers have used a separate div class for the display of the image... <div class="model"> Regards Huggie
  14. In what format, an array, a string containing html? Regards Huggie
  15. Why the question mark. Did it work? Regards Huggie
  16. You're missing a semi-colon off of the path... Try this: <?php $uname = "tmp1"; $path = 'pdf/'.$uname.'/'; $filename = '/' . $path . 'doc1.doc'; if (file_exists($path)) { echo " The Directory $path exists"; } else { echo "The directory $path does not exist"; } if (file_exists($filename)) { echo "The file $filename exists"; } else { echo "The file $filename does not exist"; } ?> This will noly work from your document root though as you're putting a forward slash in front of the path. Is that what you want? Regards Huggie
  17. Hmmm, now that is odd! ??? Try maybe this.... <?php Regards Huggie
  18. Where are you setting $table? It's not in this file. Also, you don't need the semi colon here: $check = "select id from $table where username = '".$_POST['username']."';"; Regards Huggie
  19. Possibly, but when I found the link I thought it was probably what you were after. Regards Huggie
  20. OK, and what's the output you're getting? Regards Huggie
  21. What does ssi_recentPosts() output? Regards Huggie
  22. You can use file_exists() for directories, that's why I suggested it. Look at the link I provided. Regards Huggie
  23. Check the manual for the following functions: file_exists() move_uploaded_file() mkdir() These should be the main ones you'll need. Regards Huggie
  24. OK, well without knowing what tpl_blank_sidebox.php looks like I can't really offer much help I'm afraid. Regards Huggie
  25. Sorry, typo... Change this: if (preg_match('/\.(jpg|jpeg|gif|png)$/i', $_FILES['uploadFile'. $x]['name']){ To this: if (preg_match('/\.(jpg|jpeg|gif|png)$/i', $_FILES['uploadFile'. $x]['name'])){ 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.