Jump to content

per1os

New Members
  • Posts

    3,095
  • Joined

  • Last visited

Everything posted by per1os

  1. You do not want register_globals on. Type all that out ? it really takes just a few seconds. Anyhow if you want security, yes that is the best and securest way to do it. If you want to be left open, turn register_globals on. See how long it will take for a script kiddie to trash your site. Fun stuff.
  2. No, not really I guess. I may add a few extra lines for variable declaration, but that should be done anyways. Defining variables, although unnecessary in PHP is good practice to prevent unknown data from entering into the page which could be potentially harmful.
  3. Didn't know barand's grid cost money...wait it doesn't! As for finding the right code, it could cost money but chances are someone else already did it and it is freely distributed. Just have to find to right place to get it =) The better part of this, if you learn PHP programming you can code it yourself and open it up as open source to save everyone the hassle of buying it! =)
  4. Only on pages you are posting data to. You do not "HAVE" to do that, but that will avoid errors and make the script run more efficient. Plus provides a layer of security for you. Just good coding practice.
  5. Really odd answer? You do know that is a valid answer called Scientific notation right? But yes if you using the standard math functions in PHP that is what you get, there is an extension, not sure what it is called, that can be installed to avoid that. Reply to Yzerman, $_REQUEST works, but how I see it is, I want to know that I am getting my data how I intended. Using the $_REQUEST, someone just has to append that data on to the URL and it will still be read, could be a potential security risk. That is why I stick to $_GET and $_POST.
  6. How are you using multiple queries in phpMyAdmin? If they are seperated by a comma, that would work in the script too. If you are using php5 and mysqli that might also explain it.
  7. I still say its a Javascript/css issue. Post the javascript that is used to populate the div area. What seems to be happening is that for some reason when that div is populated and than submit is hit, firefox is not retrieving the name of the select, which is why the area portion is not populated. Javascript/CSS are the parts that vary as they are client-side and not server side.
  8. You do know that phpMyAdmin uses mysql_query right? Anyhow the issue is you are not looping through the rows. <?php include('test_db_connection.php'); $result = mysql_query("SELECT `score` FROM `ranking` WHERE `id`='3' UNION SELECT `score` FROM `ranking` WHERE `id`='5'")or die(mysql_error()); while ($row = mysql_fetch_array($result)) { $rows[] = $row; } print_r($rows); ?>
  9. <?php // if $_POST['x'] has been set, assign $x the value inside of $_POST['x'] else assign it zero. // this is called the ternary operator (? which is really a shortened version of // the if/else. $x = isset($_POST['x'])?$_POST['x']:0; $y = isset($_POST['y'])?$_POST['y']:0; echo "The answer to your addition is..."; echo ($x + $y); ?> A side note, it should have been $_POST not $_GET as we are posting the data from the form and not getting. Hope that helps for more information google php ternary operator
  10. Post the html for the built page.
  11. Wheres the javascript located at? It could be something to do with that.
  12. You are assuming register_globals is on, which is very bad and is a huge security risk. Good thing they are not on (thus the zero). Try this: <html> <head> <title>Maths Addition</title> </head> <body bgcolor="black"> <font color="white"> <center><h1>Addition Form</h1> <?php $x = isset($_GET['x'])?$_GET['x']:0; $y = isset($_GET['y'])?$_GET['y']:0; echo "The answer to your addition is..."; echo ($x + $y); ?> <br /><br /><br /><br /><br /><table border="1"> <tr> <td><font color="white">Made by <font color="blue">Liam Monks</font></font></td> </tr> </table> </font> </body> </html> See if that gets you an answer.
  13. UNION is supported, subquerys are not in MySQL versions <= 3.x (maybe even 4) But UNION should be supported.
  14. My bad if(isset($id)) { echo "$id"; } Anything inside single quotes is taken literally.
  15. Welcome to the sucky world of "compliancy". FF2 is upheld to standards, IE decided to say ",.|.." to the standards which makes it near impossible to code for every browser. You will fight this till the end of time. Microsoft thinks that they are the standard. It sucks because like 90% of internet users use IE so you sort of HAVE to code for it, but as for me, I only code for FF. Anyhow this is not a PHP question, this is more of a JavaScript/CSS/HTML directed question as what you are asking for is the client-side not server side.
  16. You will always have to wait for a timeout on a ping. Even if you were to use your computers ping command, it generally tries 3 times, in about 10 seconds or so depending if there was a response. If there is no response it takes like 20 seconds. There is no easy way to determine if the server is down, even the 5 seconds could be flawed as it may take 6 seconds for the server to respond. I think your SOL.
  17. //Body Style $bodyStyle=$vehicle->vehicletype; switch ($bodyStyle){ case '': $bodyStyle = 'UNAVAIL'; break; case '2 Door Cab': case '2 Dr Reg Cab': case '4 Door Cab': $bodyStyle = 'TRUCK'; break; case '2 Door Convertible': $bodyStyle = 'CONVERTIBLE'; break; case '2 Door Coupe': case '4 Door Coupe': $bodyStyle = 'COUPE'; break; case '2 Door Hatchback': case '4 Door Hatchback': $bodyStyle = 'HATCHBACK'; break; case '4 Door Wagon': case '2 Door Wagon': $bodyStyle = 'WAGON'; break; case '3 Door Van': case '4 Door Van': $bodyStyle = 'VAN'; break; case '4 Door Sedan': $bodyStyle = 'SEDAN'; break; }
  18. <?php if(!isset($_GET['id'])) { echo "no id supplied"; }else { $id = $_GET['id']; } if(isset($id)) { echo '$id'; } ?> Try that.
  19. What I would do is split the script into "multiple processes", IE after 1,000 records run, sleep for 100 seconds etc. That way its not too much of a strain. Or another way to do it is to do the 1,000 records deal than sleep the script and do a header refresh, so it clears up the memory etc. Dunno if that would help but give it a try.
  20. I had to code for VB for a job, and hated it. I didn't mind c# but VB really takes ALL of the phone out of programming by using terms if not x = 1 then etc. I like to use regular syntax, after all we are not writing a book. Anyhow end of my rant.
  21. www.php.net/include <?php $action = isset($_GET['action'])?$_GET['action']:'index'; switch ($action) { default: case 'index': include('main.php'); break; case 'members': include('members.php'); break; case 'login': include('login.php'); break; } ?>
  22. Are you sure it is entering all of the if statements. Since you do not have any else statements to show an error message you are not sure. I would throw in some else statements so you can see where it is failing.
  23. Where are you trying to print out $id. If it is encapsulated within single quotes variable names are taken literally.
  24. Not necessarily. If you are using a tabbed browser and only close the tab of a site using sessions without ending the session, if you re-open the site in a new tab your session will most likely still be active. Well yea, because closing the tab, does not close the browser. As I stated, closing the browser will kill the session data. Not just a tab within the browser but the actual browser itself.
  25. No modify the post and put [ code ] before the start of the code and the [ /code ] after the last line. Also it would be nice of you to point out where you think the problem is, hardly anyone wants to sift through hundreds of lines of code, me being one of 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.