Jump to content

metrostars

Members
  • Posts

    169
  • Joined

  • Last visited

    Never

Everything posted by metrostars

  1. I've not done PHP for a while so forgive me if I'm wrong. You can only use the cookies on the domain you set them on. i.e. If you set the cookie on sitea.com, then you cannot access this cookie from siteb.com and vice versa. I think you'll have to look into databases and IPs to get what you want. Or set a file in sitea.com to handle all cookie set functions for both sites.
  2. Same the 1st means it is returned like 123456 12 the TRUE bit returns in like 12.123456 the first does it in microseconds followed by seconds.
  3. You could either make each image a different contact us: $rightbox = array( 'faqs' => '_img/faqanswers.jpg', 'contact-us' => '_img/contactsuccessful.jpg', 'contact-us2' => '_img/contactpotential.jpg', 'contact-us3' => '_img/contactwinner.jpg', 'login' => '_img/loginexperience.jpg', ); or a multidimensional array: $rightbox = array( 'faqs' => '_img/faqanswers.jpg', 'contact-us' => array('1' => '_img/contactsuccessful.jpg', '2' => '_img/contactpotential.jpg', '3' => '_img/contactwinner.jpg'), 'login' => '_img/loginexperience.jpg', );
  4. if(!is_numeric($value)) { //Value is not numeric } else { // Value is numeric }
  5. Just make the cell where the number is stored in the database an autonumber and then add the ICAO code when the script is called instead of storing the whole string.
  6. Even though that is a problem, it should at least rteturn an error, not a blank page.
  7. It means you have some HTML or echoed php above the script. Make sure there's no html above, inluding spaces, new lines etc.
  8. This won't work as while($row = mysql_fetch_assoc($OrderDetails)) { can only be defined once. You should do <?php $result2 = mysql_fetch_array($OrderDetails); ?> and then <?php while($row = mysql_fetch_assoc($CustomerDetails)) { Pass customer_id from $CustomerDetails query to $OrderDetails in inner loop below foreach($result2 AS $key) { Use customer_id value to drive this inner query } } ?>
  9. if (isset($_GET['sec']) == '2') { $type = "imgExp"; } if (isset($_GET['sec']) == '3') { $type = "imgPub"; } isset only can only == 1 or 0, not 2 and 3. isset only checks if $_GET has a value set, not what that value actually is. You should have it as if ($_GET['sec'] == '2') { $type = "imgExp"; } if ($_GET['sec'] == '3') { $type = "imgPub"; } and the same for the one further up.
  10. Hi. This website is about 80% complete. I'm aware that some pages aren't there. As long as the sub-header appears correctly, then all is well. Register, wait for the admin's approval and basically press every button you can see and every text box you can find. Thanks/ http://www.americanmidwestva.com/beta
  11. You could try Acunetix or something similar which basically tries everything possible to hack into the site. Helped me to find a few problems with my security.
  12. include 'tax.php'; should work. Just make sure both files are in the same folder, or use ../ or foldername1/foldername2/ etc. There is also a problem with tax.php itself: Parse error: syntax error, unexpected ';', expecting '{' in /usr/www/users/medbqq/jaco/sams2/tax.php on line 2 so make sure you fix that as it may be the problem.
  13. I'm not very good at regex. In fact I hate it. but try (untested): preg_match("/<title([.]{0,})>(.+)<\/title>/i",$file,$m) This will match <title 'then anything in here' >Blah</title>
  14. Why have you got ``data`` you only need 1 ` at each side. `data` .
  15. Try: <?php include ("hostinfo.php"); //removed the code starters and enders mysql_connect("$dbhost", "$dbuser", "$dbpass")or die("cannot connect"); mysql_select_db("$dbname")or die("cannot select DB"); $username=$_POST['username']; $password=$_POST['password']; $sql="SELECT * FROM $tbl WHERE username='$username' and password='$password'"; $result=mysql_query($sql); $count=mysql_num_rows($sql); //changed this line if($count==1){ session_start(); $_SESSION["logged"] = 1; header("location:userspage.php"); } else { $_SESSION["logged"] = 0; header("location:index.php"); } ?>
  16. You'll have to do the calculations outside EOT then put the variable in, or use "" and .
  17. It could be difficult to this, you will have to echo a large amount of rows to make sure that you diffinetly get the distinct rows that you want. The PHP behind it is easy tho.
  18. Try doing echo $_SESSION['USERNAME'] to check that the session is deffo set.
  19. metrostars

    Idea

    It will slow down the site, it can't be helped, you code may have some areas to improve upon, but it will be slower using external pages. can't be helped.
  20. I suppose a mysql query could be used, and may be the easiest way of doing this, you can also put username, date made fields into this, and it would be make a search page easier if you plan to implement that. OR you could place all of the pages into a single directory and then use some file functions which i can never remember to list them into an array, which would have less functionality.
  21. 1) I do it that way. 2) It's best to use htaccess if you know the number of varialbes that are going to be posted to each page, if not, you can have 2 /'s in the url. ie blahblah.com/egpagename/number-4434,change-yes/ which will transfer to blahblah.com/?pagename=egpagename&vars=number-4434,change-yes which can be manipulated to form the normal URLs that you are using. I'll send you the script for htaccess if you're running apahce. 3) I think it's by far the easiest. I don't know what you mean about the problem, please make it more clear.
  22. IF you know the exact width of the colums in number of characters you could do some string manipulation and put it into an array. The only problem is that if the width of the column changes, you'll have to do it a different way
  23. Maybe you should try if($_POST['dbport'] == '') instead. As it may still be set as the form has been submitted, but has beeen set to blank.
  24. Try <?php $search = "SELECT * FROM photos WHERE weeks >= CAST('$today' AS DATE)"; ?> OR if it's only going to be todays date <?php $search = "SELECT * FROM photos WHERE weeks >= NOW()"; ?> You could also try to use <?php $today = date("Y-m-d"); $search = "SELECT * FROM photos WHERE weeks >= $today"; $query = mysql_query($search) or die(mysql_error()); $total = mysql_num_rows($query); //if($total == 1) { while ($row = mysql_fetch_assoc($query)) { echo "$row[photo]"; } // } ?> to see if there are more than 1 rows being returned.
×
×
  • 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.