Jump to content

mrdamien

Members
  • Posts

    186
  • Joined

  • Last visited

Everything posted by mrdamien

  1. Does your $key variable have the forward slashes? $card = array( "/example/" => "bleh", "/pizza/" => "test" );
  2. GET and POST are not secure in any way. They both can be modified by the user. Using GET is fine, as long as you validate the input for each operation/page. If you validate properly, even if a hacker guesses a secret ID number, the information won't be available.
  3. SELECT DISTINCT game, id FROM ladders will pick one of each game. You can filter out the results with WHERE conditions.
  4. I think the watermark also needs to be a truecolor image list($waterw, $waterh, $type, $attr) = getimagesize("images/watermark.png"); $watermark = imagecreatetruecolor($waterw, $waterh); $watermark = imagecreatefrompng("images/watermark.png");
  5. If you don't set a limit, the php configured limit will be used. If you set your limit too high, people could upload tons of stuff, and use up all your disk space. Uploads take a long time because your typical internet connection has around 1/8th the upload speed when compared to the download speed.
  6. Start yourself off with this: Email: http://ca3.php.net/manual/en/function.mail.php File upload: http://ca3.php.net/manual/en/features.file-upload.php We help you with your code, we don't write it all for you.
  7. You could make each session sku variable into an object: (You would need to keep a list of the sku's) Current Order:<br> <? if(isset($_GET['submittedFormTest'])){ $sku= $_GET['sku']; $quantity = $_GET['quantity']; $price=$_GET['price']; if(!in_array($sku, $_SESSION['sku_list'])){ $_SESSION['sku_list'][] = $sku; } $_SESSION[$sku]['quantity'] += $quantity; $_SESSION[$sku]['price'] = $price; ?> <table border=1> <tr><td>Quantity</td><td>sku</td><td>Description</td><td>Price Each</td><td>Total</td><tr> <? foreach($_SESSION['sku_list'] as $sku){ echo "<tr><td>$sku</td><td>$_SESSION[$sku]['quantity']</td><td></td><td>$_SESSION[$sku]['price']</td><td></td></tr> <br />"; } } ?>
  8. If you don't need anything to be executed, your better off using $calculator = file_get_contents('include/page_files/affordability_calculator.php'); $show = ' <table class="ftrHldr"> <tr> <td valign="top"><div class="specHdr">Affordability Calculator</div>' . $calculator . '</td> </tr> </table>'; If you do need something to be executed, put the code into functions. Then you can do this: <? include('include/page_files/affordability_calculator.php'); if ($_GET['tab'] == "TestDrive"){ $show = ' <table class="ftrHldr"> <tr> <td valign="top"><div class="specHdr">Affordability Calculator</div>' . calculator_function() . '</td> </tr> </table>'; } ?>
  9. You shouldn't use spaces in your field names. And you can't use spaces in variable names. To fix that, use $submission_id= (int) $_GET['id']; $sql = "SELECT * FROM tbl WHERE `submission id` = $submission_id";
  10. When you use <input type=checkbox name=ticked[] value='$counter'> it this tells the PHP interpreter to add an element to the ticked array. So if you do ticked[] = 4 you get Array( 0 => 4 ) If you do ticked[] = 2 ticked[] = 3 You get: Array( 0 => 2, 1 => 3 ) So try this: if (isset($_POST['ticked'])) { for ($i=0; $i<count($_POST['ticked']); $i++) { $row_value = $_POST['ticked'][$i]; echo "<br>drug id: "; echo $_POST['drug_id'][$row_value]; echo " branch id: "; echo $_POST['branch_id'][$row_value]; echo " stock: "; echo $_POST['total_stock'][$row_value];} }
  11. It looks like your script relies on register_globals (which is normally off for security reasons.) To access the data from your form, make sure you use $_POST['accountflags'] $_POST['accessflags'] and $_POST['steamid'].
  12. Are you talking about a site-crawling-spider type script or just making an html link..
  13. Correct! $this-> can only be used within the class definition. This should be in the OOP section btw.
  14. Not directly in the query like that, but you can use concatenation to construct the query + loops: for($i = 1; $i<$num_rows_selected;$i++){ $part2 .= " OR region LIKE '%$region_array[$i]%'"; } $query="select * FROM bar_index WHERE region LIKE '%$region_array[0]%' " . $part2;
  15. current()/end() dont return the values your expecting, so try this instead: $numberOfRows = mysql_num_rows(); $rowCounter = 0; while(list($underpageid, $underpageauthor, $underpagetitle, $underpagetarget, $underpagestatus, $underpagelevel_x, $underpagelevel_xx, $underpagelevel_xxx, $underpagepath) = mysql_fetch_array($underpageresult, MYSQL_NUM)) { /* Here I would like to be able to say: If it's not the last row, echo "blabla", if it's the last row, echo "BLABLA", but it doesn't work: */ if ($rowCounter != $numberOfRows) { echo "blabla"; } elseif ($rowCounter == $numberOfRows) { echo "BLABLA"; } $rowCounter++; }
  16. $guery = "SELECT shops.name, shops.phone, shops.email, shops.website FROM shops WHERE name LIKE '%".$name."%'"; $result = mysql_query($query) or die( mysql_error() ); You have a typo: $guery != $query G/Q $query = "SELECT shops.name, shops.phone, shops.email, shops.website FROM shops WHERE name LIKE '%".$name."%'"; Use that instead
  17. Are you getting any errors? That code is not properly formed. else{ $code = "testcode"; if ($_POST['code'] != $code) { $form->setError($field, "* Invaild Code"); } }
  18. SELECT count(PostID) AS NumberOfPosts, Type, UserID WHERE ((UserID = 4) AND (Type = 'Video')) GROUP BY count(PostID) For a fictional database. Counts the number of video-posts by user
  19. Um yeah. Open the FLA in flash... then edit it and re-compile it...
  20. Without seeing the error message I can only guess the problem: You need to pass the link_identifier (from $link = mysql_connect()) to your class. Its basically a scope issue, your database class isn't looking outside of itself for the link_identifier
  21. Do you mean that you need to create a separate query for each `type`? Please clarify.
  22. Serialize? Yes. Do you mean "Without concurrency issues?" I don't think so.
  23. Okay. Just change "index.php?act=Arcade&do=newscore" to your site ex: "http://yoursite.com/e107/submitscore.php?act=Arcade&do=newscore" gname and gscore are the post variable being sent.
  24. Its possible but also pretty hard to implement.
×
×
  • 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.