Jump to content

sean14592

Members
  • Posts

    157
  • Joined

  • Last visited

Everything posted by sean14592

  1. hi, ok, im getting this error Parse error: syntax error, unexpected T_BOOLEAN_OR in /home/USERNAME/public_html/DIRECTORY/index.php on line 94 Know I have realised that its to dow with the if statement, proberly something todo with the '||' , any ideas? <?php $pagesavail = array ('reg', 'oc', 'owners'); $var1 = sanitize($_GET['ty']); $var2 = sanitize($_GET['oc']); if (in_array($var1, $pagesavail)) || (in_array($var2, $pagesavail)) { include ("./".$var1."/".$var2.".php"); } else { echo 'error'; } ?>
  2. ok, hi... I need to mod_rewrite http://domain.com/index.php?ty=one&oc=two so that it goes like http://domain.com/one/two Could someone paste me what goes after 'RewriteRule'. Thanks soooo much, been spending hours on this. Sean
  3. ok, now my only problem is that because the background set to the main repeats it looks weird, look at picture: http://i33.tinypic.com/t89pjt.jpg So somehow I need to set multiple backgrounds and make one repeat from bottom up and then one on top of that to NOT repeat and set it at top. I have 2 images one with the gradient back ground and then one just normal(so that it can repeat). Thanks again Sean
  4. omg your a genious, Why the hell didnt I think of that its like so simple, derr. lol, thanks man
  5. Hey, ok, Could someone please help me with this annoying 3 coloumn layout, basically there is a slight glow the the main content area on both sides. So we have a image for: -Left_side -Right_Side -and then the center is filled white. My ptoblem is whenever i run my site in IE the right coloumn drops below the left one on a new line. Code: HTML: http://pastebin.com/m23372108 CSS:http://pastebin.com/m5be8cfa9 Screenshot of what I get: http://i38.tinypic.com/2ivij9.jpg Thanks in advance. Sean
  6. ok, fixed cheers soooo much mate
  7. ok,.. thanks for your help btw I now get: Warning: getimagesize(Array) [function.getimagesize]: failed to open stream: No such file or directory in /home/spiral/public_html/phpimg/upload.php on line 89
  8. Sorry I dont understand?
  9. ok, im using this code, though even if I do uplaod a valid jpg, I still get error //DOUBLE CHECK TYPE: if image MIME type from GD getimagesize() -In case it was a FAKE! if(($info['mime'] != "image/jpeg") && ($info['mime'] != "image/pjpeg") && ($info['mime'] != "image/png")) { die("<BR><BR>Error3: Upload file type un-recognized. Only .JPG or .PNG images allowed."); } Im using php V5
  10. ah, Im still sooo confused lol. I have already checked the file extention(type), Its the fact that people can hide files under a .jpg extention any1 have msn?
  11. Hi, Im giving this script away for free to a few of my mates, though, They are saying I need to make it more secure, So that people cant change like a .exe to a.jpg so that it can pass the current security. How can I somehow make the script read the file or make sure the images are acctually images! Code: $userfile = $_POST['userfile']; //Upload Files // Configuration $maxsize = 2097152; // Maximum filesize in BYTES (currently 2MB). $upload_path = $uploaddir; // The place the files will be uploaded to (currently a 'files' directory). $filename = $_FILES['userfile']['name']; // Get the name of the file (including file extension). $ext = substr($filename, strpos($filename,'.'), strlen($filename)-1); // Get the extension from the filename. // Check if the filetype is allowed, if not DIE and inform the user. if(!in_array($ext,$allowed_filetypes)){ echo 'Opps! Image Format not allowed!'; exit; } // Now check the filesize, if it is too large then DIE and inform the user. if(filesize($_FILES['photo1']['tmp_name']) > $max_filesize){ echo 'Opps! Image is to big!'; exit; } // Check if we can upload to the specified path, if not DIE and inform the user. if(!is_writable($upload_path)){ die('You cannot upload to the specified directory, please CHMOD it to 777.'); } //This line assigns a random number to a variable. You could also use a timestamp here if you prefer. $ran = rand () ; //This takes the random number (or timestamp) you generated and adds a . on the end, so it is ready of the file extension to be appended. $ran2 = $ran; //This assigns the subdirectory you want to save into... make sure it exists! $target = "./uploads/"; //This combines the directory, the random file name, and the extension $target = $target . $ran2.$ext; if(move_uploaded_file($_FILES['userfile']['tmp_name'], $target)) { echo "<p>Your image was successfully uploaded!</p> <p><strong>Forums</strong><br /> <input name=\"textfield\" type=\"text\" id=\"textfield\" size=\"75\" value=\"[url=".$siteurl."][img=".$siteurl.$uploaddir.$ran2.$ext."][/url]\"/> </p> <p><strong>Forums (2)</strong><br /> <input name=\"textfield2\" type=\"text\" id=\"textfield2\" size=\"75\" value=\"[url=".$siteurl."][img=".$siteurl.$uploaddir.$ran2.$ext."][/url]\"/> </p> <p><strong>Direct Link</strong><br /> <input name=\"textfield4\" type=\"text\" id=\"textfield4\" value=\"".$siteurl.$uploaddir.$ran2.$ext."\" size=\"75\" /><p> "; } else { echo 'Opps! Looks like we have a problem....<br><br>'; echo '<b>Error: <FONT COLOR="#FF3300"><u>There was a weird error!</u></b></font>'; exit; exit; }
  12. FIXED! Thanks ppl cheers
  13. Hi, Im doing a simple MYSQL query and then echoing on to the page... Here is the mysq connect at the top of the page, I know this works as I do echo out other things and that works.. <?php if (!isset($_GET['id'])) { echo 'NO ID PROVIDED!'; exit(); } if (isset($_GET['id'])){ $id = $_GET['id']; // Make a MySQL Connection mysql_connect("$db_host", "$db_username", "$db_password") or die(mysql_error()); mysql_select_db("$db_database") or die(mysql_error()); // Retrieve all the data from the "example" table $result = mysql_query("SELECT * FROM properties where id=$id") or die(mysql_error()); // store the record of the "example" table into $row $row = mysql_fetch_array( $result ); // Print out the contents of the entry ?> Here is the code with somehing wrong, In the database lowprice1 = 1..Yet it is not echoing the row. <table width="100%" border="0"> <tr> <td width="43%"><strong>Season</strong></td> <td width="16%"><strong>From</strong></td> <td width="16%"><strong>To</strong></td> <td width="25%"><strong>Price Per Week</strong></td> </tr> <?php if ($row['lowprice1'] != "") { echo "<tr> <td>Low</td> <td>".$row['lowfromday1']." ".$row['lowfrommonth1']."</td> <td>".$row['lowtoday1']." ".$row['lowtomonth1']."</td> <td>£".$row['lowprice1']."</td> </tr>"; } ?> </table> Any help would be nice. cheers sean
  14. This might help, here is my full page code.... http://pastebin.com/m2c98b7c7 Thanks every1 again for helping sean
  15. Im using a simple mysql query. lol, im confused. sean
  16. Hello, I have a small problem withe thayout of images. I basically have some images/text and I want to put them into a table, Though my problem is I only want to have 5 images/text per coloumn. Here is my code: <?php if ($row['onpool'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="72" valign="middle"><span class="style3">Pool</span></td> </tr> </table>'); } if ($row['oncar'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="72" valign="middle"><span class="style3">Car Park Area</span></td> </tr> </table>'); } if ($row['onenter'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="72" valign="middle"><span class="style3">Entertainment</span></td> </tr> </table>'); } if ($row['onrest'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="72" valign="middle"><span class="style3">Resturant/ Cafe</span></td> </tr> </table>'); } if ($row['onlaun'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="72" valign="middle"><span class="style3">Laundret</span></td> </tr> </table>'); } if ($row['onsuper'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="72" valign="middle"><span class="style3">Supermarket</span></td> </tr> </table>'); } if ($row['ongym'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="72" valign="middle"><span class="style3">Gym</span></td> </tr> </table>'); } if ($row['onbar'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="72" valign="middle"><span class="style3">Bar</span></td> </tr> </table>'); } if ($row['ongolf'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="72" valign="middle"><span class="style3">Golf</span></td> </tr> </table>'); } if ($row['ontennis'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="72" valign="middle"><span class="style3">Tennis Courts</span></td> </tr> </table>'); } if ($row['onchildplay'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="100" valign="middle"><span class="style3">Childrens Play Area</span></td> </tr> </table>'); } if ($row['onchildclub'] == "yes"){ echo ('<table width="100" border="0"> <tr> <td width="18" valign="middle"><img src="./images/tick.jpg" width="18" height="18" /></td> <td width="100" valign="middle"><span class="style3">Childrens Club</span></td> </tr> </table>'); } ?> Please help me, Thanks soooo much Sean
  17. Im, using a slideshow script and it uses this xml to fetch the images.... [code] <?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?> <root> <settings bordercolor="0xFF0000" delay="20" step="10" a="140"/> <images> <img src="images/ws2-b1581-20040201181235-t.jpg" alt="www.frogstyle.ch" width="128" height="96" big_src="images/ws2-b1581-20040201181235-g.jpg" big_width="640" big_height="480"/> <img src="images/ws2-b1570-20040201180406-t.jpg" alt="www.frogstyle.ch" width="128" height="96" big_src="images/ws2-b1570-20040201180406-g.jpg" big_width="640" big_height="480"/> <img src="images/ws2-b1572-20040201180444-t.jpg" alt="www.frogstyle.ch" width="128" height="96" big_src="images/ws2-b1572-20040201180444-g.jpg" big_width="640" big_height="480"/> </images> </root> Though I need the image to change to a var fetched from mysql, So that it looks like this. <?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?> <root> <settings bordercolor="0xFF0000" delay="20" step="10" a="140"/> <images> <img src="$siteurl."properties/owners".$row['username']."images/ws2-b1581-20040201181235-t.jpg" alt="www.frogstyle.ch" width="128" height="96" big_src="$siteurl."properties/owners".$row['username']."images/ws2-b1581-20040201181235-g.jpg" big_width="640" big_height="480"/> <img src="$siteurl."properties/owners".$row['username']."images/ws2-b1570-20040201180406-t.jpg" alt="www.frogstyle.ch" width="128" height="96" big_src="$siteurl."properties/owners".$row['username']."images/ws2-b1570-20040201180406-g.jpg" big_width="640" big_height="480"/> <img src="$siteurl."properties/owners".$row['username']."images/ws2-b1572-20040201180444-t.jpg" alt="www.frogstyle.ch" width="128" height="96" big_src="$siteurl."properties/owners".$row['username']."images/ws2-b1572-20040201180444-g.jpg" big_width="640" big_height="480"/> </images> </root> So it includes variables, How can I do this or is there anythere way? Cheers Sean[/code]
  18. FIXED! if($_FILES['photo1']['size'] == 0 ) Thanks anyway Sean
  19. nope, still no error, when i don't enter anything sean
  20. Hi, For some reason, when I enter nothing in the file field named 'photo1' and then go to the next step to check if the field is empty, it isen't returning empty. weird! $_SESSION['photo1'] = $_FILES['photo1']; //Check if above is empty if ((empty($_SESSION['photo1'])) || (!isset($_SESSION['photo1']))) { echo '<br><center>'; echo 'Opps! Looks like we have a problem....<br><br>'; echo '<b>Error: <FONT COLOR="#FF3300"><u>Photo 1 Field Empty!</u></b></font>'; echo '<br><br><a href="'.$siteurl.'index.php?p=oaddprop11"><img src="'.$siteurl.'style/form/fix_error.gif" width="240" height="40" border="0" /></a>'; exit; } Is that right? Cheers Sean
  21. Fixed, here is new code tht works.... $username = $_SESSION['username']; mkdir("./properties/temp_images/".$username); cheers sean
  22. Hi, I need to create a directory named after the username which is stored in a session, Though I ge the following error.... Warning: mkdir(http://www.************.com/properties/temp_images/sean844) [function.mkdir]: No such file or directory in /home/*******/public_html/pages/oaddprop12.php on line 177 My code is: $username = $_SESSION['username']; mkdir("".$siteurl."properties/temp_images/".$username.""); Can anyone see anythign wrong? Cheers Sean
  23. have u got msn, so i can let u try on my site? cheers sean
  24. ok, I tried that script like before, I works if i enter <a>, it displays "lol" Though it also displays "lol" if I enter "dsdasdas" weird sean
×
×
  • 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.