Jump to content

High_-_Tek

Members
  • Posts

    72
  • Joined

  • Last visited

    Never

Everything posted by High_-_Tek

  1. First off, you dont need the "" or the {} around the $var assignment $type = $_POST['type']; And it will return true always because you will always have one value selected since you did not provide a null option in the form (even so you'd have to use empty() to test for a null value)
  2. Anything you include or require with <?php ?> tags is executed as PHP at run-time. No you cannot assign a require call to a var but any var declared in the required file WILL become available to the file that included it. For example this will work: a.php <?php $a = 'lol'; ?> including file <?php include('a.php'); echo $a; // Produces 'lol' ?>
  3. Ok after some testing I have assured that the $id var passed in the URL is correct But yet still, only 1 unit displays out of all of them
  4. Im going through a few tests right now, will report on results @Barand: I didnt post the whole loop
  5. Time for a tucker! Well Im building a sort of catagory heirachry system for units.  The way it works is:  There are top units which have the unit_heiarchy id (in mysql) of 0.  The units that fall under that have a catagory heircharchy of 1 (the 1 signifies the unit ID (Primary key) of the top unit).  That repeats basically So when I run this query in phpMyAdmin I get all the units I want: (Remember the $id var here is the ID of the top unit you clicked on) $sql = $db->sql_query("SELECT unit_banner, unit_name, designation, unit_heirarchy, id FROM atfcs_units WHERE unit_heirarchy = $id ORDER BY id ASC"); But when I run that in PHP, I only get the top set. with this code: while ($row = $db->sql_fetchrow($sql)){       echo "<img src='" . $row['unit_banner'] . "' />" . '<br />';   echo "<b><a href='modules.php?name=" . $module_name . "&op=roster&id=" . $row['id'] . "'>" . $row['unit_name'] . '</a></b>  -  <i>' . $row['designation'] . '</i><br />'; Am I missing something herea about the code repitition in the while()? On using a print_r on $row I only get 1 unit instead of all of them Thanks for the great work here:)
  6. Or you could make it as painless as possible and... use an onSubmit="window.location('url here')"
  7. Never Mind, using the list() now
  8. mysql_select_db('database')
  9. Or you can use: ___constructor()
  10. Well that seems a tad over-complicated to me... Try this (it does about the same thing) [code] $email = $_POST['u_email']; $parts = explode("@", $email); $host = $parts[1]; if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email) && strlen($email) > 0) { die('Email Address is not Valid'); }else{ if (!f open($host, 'r')){ die('Email Server is not Valid!'); } } [/code] This checks to see if the addr is in the proper format and the domain host @xxxxx.yyy exists (yahoo.com, hotmail.com, etc) :)
  11. Your pretty much going to have to use a DB here.... And yes, its called a variable $var_name
  12. Short and simple [code] <?php unset($_COOKIE['activsessid']); ?> [/code]
  13. PHP Nuke standard sucks, Ive been using / hacking it (modding it) for the past 3 years. Try PHP Nuke Evolution ... it's basically a re-written Nuke which is more security, features, and useability. www.nuke-evolution.com ;)
  14. I almost NEVER code in OOP, but if you are using this inside a class it should be: [code] $this->$v_user = mysql_query("SELECT * FROM $u_table WHERE $u_row = $username") or die("Error: " .mysql_error()); [/code] or [code] $this::$v_user = mysql_query("SELECT * FROM $u_table WHERE $u_row = $username") or die("Error: " .mysql_error()); [/code]
  15. If you use WHM to create accounts or use CPanel as a reseller.. Find out the address that CPanel / WHM uses as a form action I know for a FACT that CPanel uses a ton of $_GET's for the information
  16. Go to: [a href=\"http://localhost/SCRIPTNAME.php\" target=\"_blank\"]http://localhost/SCRIPTNAME.php[/a] ;)
  17. [code] $sql1 = "SELECT admin FROM Employee WHERE empUsername='$_POST[empUsername]'"; $result1 = mysql_query($sql1) or die("Couldn't execute query."); $result=mysql_fetch_array($result1); if ($result['admin'] == 1) [/code] You didnt get the stuff
  18. You need to fetch the stuff [code] <?php include('dbconnect.php'); $query="SELECT runtime FROM missionruntime"; $query1="SELECT start FROM missionruntime"; $runtime=mysql_fetch_array(mysql_query($query)); $start=mysql_fetch_array(mysql_query($query1)); if ( $start['start'] == 2006-04-19 13:51:59 ) { echo "SERVER DOWN"; } else { echo {$runtime['runtime']}; } ?> [/code]
  19. [code] <?php $pass=md5($_POST['pass']); $sql=mysql_query("SELECT * FROM phpbb_users WHERE username='$_POST[user]' AND user_password='$pass'); ?> [/code] Simple Passwords are encrypted with md5() once
  20. Go into whatever FTP client you use and chmod the folder where your uploads are going to: 777
  21. [code] <?php $var=1; $vat++; header("Location: index.php"); ?> [/code]
  22. [code] <?php if(isset($_POST['submit'])) { @extract($_POST); $name = stripslashes($name); $email = stripslashes($email); $brand = stripslashes($brand); $model = stripslashes($model); $country = stripslashes($country); $op = stripslashes($op); $imei = stripslashes($imei); mail('*purposely_removed*','Unlock Request',"Brand: $brand \n Model: $model \n Country: $country \n Operator: $op \n IMEI: $imei \n Proof: $proof \n Email: $email","From: $name <$email>") or die("Error sending information. Please contact bridgey[at]gmail.com"); // don't send this text to the browser //echo("<font color=yellow><b>Thank you, your request has been sent. A reply will be sent to the email address you provided.</b></font>"); // redirect the browser header("Location: http://www.scott-hodson.com/bridgey/thanks.php"); exit; } else { echo "<font color=orange><b>You must fill in all fields before sending.</b></font>"; } ?> [/code] Try that
  23. [code] if (pregi_match(".gif$", $_POST['tool_icon'])){ $ok=TRUE; }else{ $ok=FALSE; } [/code]
  24. [code] <?php switch($_GET['id']) {     case "aboutus":    include('aboutus.php');   break;   case "contactus":    include('contactus.php'); break; default:    include('home.php');   break;   } ?> [/code] :)
  25. Fix: [code] $sql="SELECT COUNT(*) FROM members WHERE owner='$valid_user'"; [/code] And make sure $valid_user is set :S
×
×
  • 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.