Jump to content

StormTheGates

Members
  • Posts

    170
  • Joined

  • Last visited

Everything posted by StormTheGates

  1. Are you sure your mail SMTP server is running and working on your server?
  2. Do 0-9 instead. Otherwise 0 will be excluded
  3. Adjust your query to include unions. Example: $query = mysql_query("SELECT h.proj_title AS html_title, h.proj_decrip AS html_descrip, h.proj_imagepath AS html_image, f.proj_title AS flash_title, f.proj_decrip AS flash_descrip, f.proj_imagepath AS flash_image, d.proj_title AS 3d_title, d.proj_decrip AS 3d_descrip, d.proj_imagepath AS 3d_image, i.proj_title AS image_title, i.proj_decrip AS image_descrip, i.proj_imagepath AS image_image FROM html h, flash f, 3d d, imagery i WHERE h.id>1"); while($m = mysql_fetch_row($query)){ $htmlimg = $m[0]; $htmltitle = $m[1]; $htmldesc = substr('$m[2]', 0, 100); $flashimg = $m[3]; $flashtitle = $m[4]; $flashdesc = substr('$m[5]', 0, 100); $3dimg = $m[6]; $3dtitle = $m[7]; $3ddesc = substr('$m[8]', 0, 100); $imageryimg = $m[9]; $imagerytitle = $m[10]; $imagerydesc = substr('$m[11]', 0, 100); } Something like this perhaps?
  4. I know Java is powerful. I just hate it because of its Virtual Machine and memory whoreage issues.
  5. if(ereg("[^[:digit:]]", $input)) { echo "Not a good amount!"; } Makes sure its only numeric. However I think that if(!ctype_digit($input)) { $error = "Not a good amount!"; } Is better
  6. Yes that is possible. Just make sure the file exists. You need a . before html though
  7. Its just mysql. Ive sorta come up with a solution where I set a session called LOCKED to true at the start of the script and then false at the end. That way if they submit one it locks, and then the second runs up against the check to see if its locked. Think this will work?
  8. Uhm how about this: $length = strlen($input); if($length != 4 OR $input < 100) { echo "Must be 4 chars and over 100!"; }
  9. PHP has a strip_tags function that should strip all the HTML for you.
  10. Maybe try something like this? $return = json_encode($return); echo "$return";
  11. And its not printing out any errors or anything? Also your script is insecure, you never want to use a direct user input in an SQL query unless youve checked it for SQL injection. Although I dont see any definitions for the variables for the db connector. So maybe its not connecting?
  12. Do this: $result = mysql_query($sql) or die(mysql_error()) That will show you the error that your update is generating and to why its not updating. Then it should be easy to find the cause
  13. Ok basically I dont know a solution. I can however theorize one: foreach(){ $end = substr('$name', -3, 1); if($end != "txt"){ $i++ } else { echo "$name"; $i++; } } Or something along those lines.
  14. Aright this has been a big issue for me as well. Heres what Ive discovered: PHP - For small-medium size businesses ASP.NET- For enterprise level businesses. Also Learning .net will not help you learn C#, that is VB.NET Java- {snip} JAVA. Sorry had to say it....
  15. You mean like make sure they have data in them? if(!$_POST['name']){ echo "You need to submit a name!"; } elseif(!$_POST['pass']){ echo "You need to submit a password!"; } else { // Do db stuff }
  16. Ok I cant really be bothered to read it all. So I looked at the title and here is some code that I use for my game that you can use for populating tables with all entries: <?php echo " <table width=300 cellspacing=1 cellpadding=1 border=0 bordercolor=black class=black2> <tr> <td colspan=4 class=header><div align=center>Last 10 Attempts On Your Life </div></td> </tr>"; $result = mysql_query("SELECT * FROM attempts WHERE defender='$username' ORDER BY `id` DESC limit 0,10"); while ($info = mysql_fetch_row($result)) { echo " <tr class=text> <th width=1></th> <td width=135>$info[1]</td> <td>$info[2] shot at you, and you $info[4]</td> <th width=1></th> </tr>"; } echo "</table>" ?> If you have all your things in an array like $array = "Toys-5.00-Bob" Then just do this for the code: $result = mysql_query("SELECT array FROM attempts WHERE defender='$username' ORDER BY `id` DESC limit 0,10"); while ($info = mysql_fetch_row($result)) { $stuff = explode("-", $info[0]); echo " <tr class=text> <th width=1></th> <td width=135>$stuff[0]</td> <td>$stuff[1] shot at you, and you $stuff[2]</td> <th width=1></th> </tr>"; }
  17. You could do something like this I think: $type = $_POST['radio']; if($type == "pictures"){ $uploadto = "picturesir"; } elseif ($type== "movies){ $uploadto = "moviesdir" } else { $uploadto = "textdir"; } Or something like this?
  18. // Opens the connection to database to access the data $link = mysqli_connect('localhost', 'user', 'password, 'fromthedatabase'); That is throwing an error. If you are connecting to the db try this: $db = mysql_connect("localhost", "name", "password") or die(mysql_error()); mysql_select_db("game", $db);
  19. Here is a little primer chart that I just made for you ----------------------------------| | Read | Write | Execute | |------|-------------|------------| |Owner| x | x | x | |------|-----|-------|------------| |Group| x | x | x | |------|-----|-------|------------| |Other | x | x | x | |---------------------------------| That is a chmod 777 What you had at 755 was ----------------------------------| | Read | Write | Execute | |------|-------------|------------| |Owner| x | x | x | |------|-----|-------|------------| |Group| x | | x | |------|-----|-------|------------| |Other | x | | x | |---------------------------------| The writing part I think was the problem. Try changing to 775(Group write) or 757(Other write) Chmod 777 isnt the best, its the most open. So try and contain it as much as possible with other peoples access.
  20. Try changing the chmod to 777. That will have full access for everyone, briefly test that. If it works you know its a chmod problem. If not you can change it back.
  21. How about just something like this? if($failed == true){ header("Location: failed.php"); } And just have failed.php be the words "You failed" or whatever?
  22. Something like this? $query = mysql_query("SELECT image, title, desc FROM table WHERE id>1 LIMIT 2"); while($m = mysql_fetch_row($query)){ $img = $m[0]; $title = $m[1]; $desc = substr('$m[2]', 0, 100); } Then later down echo them into the HTML?
  23. Aright 2 things I noticed. Where is $config_dir defined? Secondly, I sure hope you have some form of validating thing on those posts, because you are plugging direct user input into an SQL query and you are going to suffer massive SQL injection attacks.
×
×
  • 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.