Jump to content

DarkerAngel

Members
  • Posts

    330
  • Joined

  • Last visited

Everything posted by DarkerAngel

  1. First of all that SQL statement is just wow I don't know if I would even want to touch it, I don't know if it would work, but it's one of those thing that you see and think if I touch this thing I'm going to break it. Secondly I think JavaScript or better yet AJAX would be the way to go. AJAX can run the code in the background (the check), and once validated submit it.
  2. if ( move_uploaded_file ($_FILES['uploaded'] ['tmp_name'], 'upload/' . $_FILES['name'])){ Echo 'Successful'; } else{ Echo 'Not Successful'; } You know its probably such a tiny thing but if you look here: $_FILES['uploaded']['tmp_name'], you will notice a space.... try: if ( move_uploaded_file ($_FILES['uploaded']['tmp_name'], 'upload/' . $_FILES['name'])){ Echo 'Successful'; } else{ Echo 'Not Successful'; } PHP Can be a :-X like that at times
  3. <img height="xx" (or width="xx") src="[file]" /> Most modern browsers now will lock the ratio of the image to prevent distortion (if only one size restriction is placed,) if it's possibly going to be used in older browsers you may want to think about a script to create the height/width calculation or a script to create thumbnails.
  4. You know it's strange but I had this problem when I had HTML code enabled with the BBcode on my forum, I disabled HTML and it cleared the problem up. My forum is phpBB port for PHPNuke, if you need the HTML I don't know how to help you.
  5. <?php require_once('db.php'); $query = mysql_query("SELECT * FROM image WHERE thumb = '1'"); while($row = mysql_fetch_assoc($query)) { ?> <ul> <li><img src="upload/<?PHP echo $row['imagedata']; ?>" /></li> <li></li> </ul> <?php } ?> Something close to that?
  6. When a user uploads a file it's stored in a temporary location. Most standard functions return some kind of data. move_uploaded_file() moves a file from the temporary upload location (usually inaccessible by normal users) and moves it to where you want it to be, in most cases a public location. the function usually returns true on success... but if not it returns False the if() just checks if it was successful, so you don't run code that you would only want to run if it was successfully moved. that's all
  7. I am with you about not really preferring Joomla, but I don't quite understand what your question means about having to have it be the whole site... I mean no, you can have it just be a portion of your site no problem if you know what your doing.
  8. this is the best I can do for ya that does what you want. <?php eval("\$cell" . $row_pos['left'] . "x" . $row_pos['top'] . " = \"" . $row_pos['word'] . "\";"); ?> God knows why you need something like that but there it is.
  9. Here is a little function I wrote for you. string format_date(string $date_str) <?php function format_date($date_str) { $date_arr = explode("-", $date_str); return date("F S, Y", mktime(0, 0, 0, $date_arr[0], $date_arr[1], $date_arr[2]); } ?>
  10. Maybe in your or die(mysql_error()); you should have or die(mysql_error()."<br>Query Was: "$query); or die(mysql_error()."<br>at Query: 21"); (enter anything to identify the line)
  11. Well I'm sorry for one I had my code backwards a little bit, this will output exactly what you want (from the post), though I don't know the table names that you use so I'm going to sub table1 and table2 in accordance to your first post. <?php $query = "SELECT table1.amount, table2.username FROM table1, table2 WHERE table1.who = table2.id ORDER BY amount DESC LIMIT 1" $sql = mysql_query($query); $array = mysql_fetch_array($sql); echo("most: ".$array['amount']." user ".$array['username']); ?>
  12. <form action="contents.php?id=11" method="post"> <input type="text" name="search"/> <select name="fields"> <option>Actualité</option> <option>Annonces</option> <option>Culture</option> </select> <input type="submit" name="submit" value="chercher"/> <input type="hidden" name="id" value="11"/> </p> </form> ??? ???
  13. This really has nothing to do with PHP and should have been posted in the MySQL forum, but SELECT attack.table1, who.table1, type.table1, unit.table1, amount.table1, id.table2, username.table2, handle.table2 FROM table1, table2 WHERE who.table1 = id.table2 ORDER BY amount.table1 That's just something rough though but it should work.
  14. Investigate how to use FOPEN or cURL, both of those can be used to get data off of another website.
  15. I'm sure there is something better but this is close to what I always use <?php $query = "SELECT username FROM users WHERE username = '{USERNAME}'"; $sql = mysql_query($query); if(mysql_num_rows($sql)) { /* User Exists Code */ } else { /* User NOT Exists Code */ } ?>
  16. I'm not sure I lost my list of MySQL globals but I think default might be a global so try backticking it SELECT * FROM product_images WHERE product_id='{$_GET['id']}' ORDER BY `default` DESC
  17. Nope, because we don't know what progress bar type your using or how your using it, your giving poor information and asking for information, try posting some relevant code and what is currently occurring. But I do believe you made your desired results quite clear.
  18. So you would want something like this? RewriteRule ^(.+)/(.+)$ /index.php?$1=$2 [L] ???
  19. Could you tell me what it's doing that you don't want it to do? RewriteRule ^blog/([0-9]+)$ /index.php?blog=$1 [L] And I agree with Wolphie, this looks like it needs to be in the Apache forum
  20. This isn't a vary secure check but add a conditional statement before the move_uploaded_file(); if(substr($_FILES['filename']['name'], -3) == "doc") { ... }
  21. <?php $ret = "[annon 75 Arch Magus] Yuari (Iksar) zone: gfaydark AccID: 298 AccName: Flora LSID: 110561 Status: 0 [72 Soothsayer] Kefus (Iksar) zone: qrg AccID: 307 AccName: Nerine LSID: 110954 Status: 0 [74 Wildblood] Tigger (Vah Shir) zone: gukbottom AccID: 244 AccName: harkenus2 LSID: 112355 Status: 0 3 players online"; $array = explode("\n", $ret); $roster = array(); $i = 1; foreach ($array as $key => $value) { if(preg_match("#\[([0-9]+) ([a-zA-z ]+)\] ([a-zA-Z]+) \(([a-zA-Z ]+)\) zone: ([a-zA-Z]+)#", $value, $out) || preg_match("#\[[a-zA-Z]+ ([0-9]+) ([a-zA-z ]+)\] ([a-zA-Z]+) \(([a-zA-Z ]+)\) zone: ([a-zA-Z]+)#", $value, $out)) { $roster[$i] = array("name" => $out[3], "level" => $out[1], "class" => $out[3], "race" => $out[4], "zone" => $out[5]); $i++; } } echo("<pre>"); print_r($roster); echo("</pre>"); ?> It's a little bit over coded but it works with the results, Currently it will output: Array ( [1] => Array ( [name] => Yuari [level] => 75 [class] => Yuari [race] => Iksar [zone] => gfaydark ) [2] => Array ( [name] => Kefus [level] => 72 [class] => Kefus [race] => Iksar [zone] => qrg ) [3] => Array ( [name] => Tigger [level] => 74 [class] => Tigger [race] => Vah Shir [zone] => gukbottom ) ) Also it does the anomaly check in case of [annon 75 Arch Magus]
  22. <?php $folder = "C:/wamp/www/vgotjobs/upload/"; if(is_uploaded_file($_FILES['filename']['tmp_name'])) { if(move_uploaded_file($_FILES['filename']['tmp_name'], $folder.$_FILES['filename']['name'])) { Echo "File uploaded"; } else { Echo "File not moved to destination folder. Check permissions"; } } else { Echo "File is not uploaded."; } ?>
  23. you have it backwards if the field is called `id_owner` it would be WHERE `id_owner`='[however you have your data set]'
  24. mysql_query("UPDATE `game_planets` SET `belcredits`=`belcredits`+100 WHERE `username`='username' LIMIT 1"); There is an example of how it would update only one record based on username being usersname though I highly suggest using an ID field and ID being a UNIQUE.
  25. this is the exact code I have running on my site (converted to PHP output and to accommodate your usage) <?php echo("<script type=\"text/javascript\">\nfunction uploadwindow() { new_window = window.open('../imageupload/index.php','popup','width=500,height=500,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); } </script> <a href=\"javascript:uploadwindow();\">Upload Photo</a>"); ?>
×
×
  • 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.