Jump to content

dezkit

Members
  • Posts

    1,236
  • Joined

  • Last visited

Everything posted by dezkit

  1. well first you can explode() them by comma, then explode() them by =
  2. $query = "SELECT * FROM $tbl_name WHERE Class='".$classname."' ORDER by Class";
  3. $UserId=mysql_real_escape_string($_GET['id']); don't forget.
  4. Use a while loop to send all people an email. Bonus: Ajax loader if your database is huge
  5. remove $process = mysql_fetch_assoc($result);
  6. $data = mysql_query("SELECT DISTINCT db_Appcategory FROM application_directory") or die(mysql_error()); Not sure what you're trying to ask, but the sql above will only echo unique db_Appcategorys, no multiples.
  7. <?php session_start(); $username="xxxx"; $password="xxxx"; $database="xxxx"; $host="xxxx"; $user=stripslashes(mysql_real_escape_string($_POST['user'])); $pass=stripslashes(mysql_real_escape_string($_POST['pass'])); @mysql_connect($host,$username,$password); @mysql_select_db($database) or die("Unable to select database"); $sql="SELECT username, `password` FROM users WHERE username='$user' and `password`='$pass'"; $r=mysql_query($sql); if(!$r){ $err=mysql_error(); print $err; exit(); } if(mysql_affected_rows()==0){ header("Location:user_login.htm"); print "Invalid User Name/Password. Please try again"; exit(); } else{ header("Location:memberhome.htm"); $_SESSION["user"] = $user; exit(); } ?> memberhome.php <- note it must be php <?php session_start(); if(!$_SESSION["user"]){ header("location: index.php"); } // all the code that the member can see echo "Welcome back," . $_SESSION["user"]; ?> I suggest you look into this tutorial - http://phpeasystep.com/phptu/6.html
  8. <?php $query1 = "SELECT * FROM `example1` LIMIT 0 , 2"; $result1 = mysql_query($query1) or die(mysql_error()); $i=1; $rows = array( ); while($row1 = mysql_fetch_array($result1)){ $rows[$i]["name"] = $row1["name"]; $rows[$i]["id"] = $row1["id"]; $i++; } $query2 = "INSERT INTO example2 (id_1,name_1,id_2,name_2) VALUES('".$rows[1]["id"]."','".$rows[1]["name"]."','".$rows[2]["id"]."','".$rows[2]["name"]."' ) "; $result2 = mysql_query($query2) or die(mysql_error()); ?> Is this what you needed?
  9. huh? what is my script not doing right for you? - It takes two random rows - while its looping through the rows it's... -- inserting the data to another table -- deleting the data in the original table
  10. IN REPLY TO: <?php $query1 = "SELECT * FROM example1 LIMIT 0, 2"; $result1 = mysql_query($query1) or die(mysql_error()); while($row1 = mysql_fetch_array($result1)){ $query2 = "INSERT INTO example2 (id, name) VALUES('".$row1["id"]."', '".$row1["name"]."' ) "; $result2 = mysql_query($query2) or die(mysql_error()); $query3 = "DELETE FROM example1 WHERE id='".$row1["id"]."'"; $result3 = mysql_query($query3) or die(mysql_error()); } ?> Is this what you wanted?
  11. You are awesome! Thanks So I'm guessing anytime it has an encapsulating tag of its own it needs to be included in that foreach? Yeah!! I thought you had included that thing lol, I thought it was a problem on php's side, but then I re read the xml.
  12. <?php $forecast = simplexml_load_file('http://www.google.com/ig/api?weather=New%20York'); foreach ($forecast->weather->forecast_conditions as $weather) { echo $weather->day_of_week["data"]; } ?> lol
  13. try foreaching echo $weather->day_of_week["data"]; if doesnt work: echo $weather["day_of_week"]["data"];
  14. you should also use trim() incase there is an accidental space in the beginning
  15. Wait are you trying to get two different rows? Sorry, I'm confused at what your doings.
  16. if($timenow1 == $timenow5 && $timenow2 >= $timenow6){ $update1 = mysql_query("UPDATE leagues SET status='0' WHERE id='$id'"); $update2 = mysql_query("SELECT * FROM leagueplayers WHERE league='$id'"); while ($player1 = mysql_fetch_array($update1) && $player2 = mysql_fetch_array($update2)) { echo $player1[id]; echo"-"; echo $player2[id]; } } try this
  17. I'm not sure but I think another solution can be a sql join, is that correct?
  18. What are you trying to say? You want to get all the data from another sql database to your own? You may want to export the sql in the export tab in the other database.
  19. Umm, you can use simpleXML instead, easier.
  20. $next_date = strtotime($i++." day", strtotime($start_date)); should work
  21. Well if you are not using an admin system you can use this -> using array: $blockIPs = "192.168.1.1,127.0.0.1"; $blockIPs = explode(",",$blockIPs); foreach($blockIPs as $IP){ if($_SERVER['REMOTE_ADDR'] == trim($IP)){ header("location: you-are-banned.html"); } } using database: $result = mysql_query("SELECT * FROM ip_ban_list") or die(mysql_error()); while($row = mysql_fetch_array( $result )) { if($_SERVER['REMOTE_ADDR'] == $row["ip"]){ header("location: you-are-banned.html"); } } oh and btw-CV, I just totally got suprised when I saw a quote of mine in your signature, haha!
  22. <?php if($logged == "yes"){ // number 3, notice how i closed the php tag, to the right-> ?> <div class="urbangreymenu"> <h3 class="headerbar">Pilot Center</h3> <ul> <li><a href='ATR42.php'><b>ATR42 Schedules</a></li></b> <li><a href='skedatr.php'><b>ATR42F Schedules</a></li></b> <li><a href='b737.php'><b>B737 Schedules</a></li></b> <li><a href='a310.php'><b>A310 Schedules</a></li></b> <li><a href='b767.php'><b>A300 Schedules</a></li></b> <li><a href='b777.php'><b>B777 Schedules</a></li></b> <li><a href='b747.php'><b>B747 Schedules</a></li></b> <li><a href='logbook.php'><b>My logbook</a></li></b> <li><a href='download.php'><b>Download Section</a></li></b> <li><a href='help.php'><b>Pilot's Manual</a></li></b> <li><a href='rankings.php'><b>Rankings</a></li></b> <li><a href='pilotroster.php'><b>Pilot hours</a></li></b> <li><a href='flights.php?map=karachi' target='_blank'><b>Flight Movements</a></li></b> </ul> </div> <?php // <- here also }?> There were a couple problems- 1. You forgot to close <ul> 2. Dont use php short tags, they are the bad. 3. When echo'ing outside of php tags, you have to close them
×
×
  • 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.