Jump to content

mac_gyver

Staff Alumni
  • Posts

    5,449
  • Joined

  • Days Won

    174

Everything posted by mac_gyver

  1. the error message is pretty self explanatory. did you look at line 19 and try to figure out why your code is supplying an array instead of a string to the explode() function, especially since your code isn't even using the result from the explode() statement on line 19?
  2. the gibberish is the raw binary data, which means your code is finding, reading, and outputting the file, but the header's aren't working. you need to also set php's display_errors to ON, in addition to setting error_reporting, to see what php errors are being detected - ini_set("display_errors", "1");
  3. you would need to fetch the row from the result set that the query matched and then reference that field in the fetched row. also, please post code using the forum's bbcode tags so that it will be highlighted and in a scrollable box. using the bbcode tags, it's hard to tell which of your posted code is not commented out and is the actual code in question. finally, this thread is/was marked as being solved/answered so most people are not going to look at your follow up question in it. i have marked it unsolved for you.
  4. of the two links i posted above, the first one is more through and includes an api that emulates the dbase functions. it looks like you can just change the function names from dbase to xbase
  5. @NiallFH, since you started a new thread after this, one using array names in your form, so that you would even have arrays in the form processing code, this thread is no longer active. just because your code for an issue evolves, don't start new threads for the same problem, continue in the same thread, or at least have the consideration to go back to earlier threads and post in them that you no longer need help with the stated issue.
  6. what does it do and exactly at what point in the form/form processing program execution doesn't it work? is the 'view source' of the form correct? is the $modifysubs variable true so that the code branch even runs? what have you done to pin down where the problem is at (we don't have your complete code, your data, nor are we standing right next to you and cannot run your code nor did we see what you saw that leads you to believe the other code doesn't work.)
  7. here is an alternative (untested) method - http://www.phpclasses.org/package/2673-PHP-Access-dbf-foxpro-files-without-PHP-ext-.html and another one - http://www.phpclasses.org/package/1302-PHP-Extract-information-from-a-DBF-database-file.html
  8. the php_dbase.dll file must be compiled for the same version and thread-safe or non-thread-safe flavor of php that you are using. where did you get this php_dbase.dll file at?
  9. what database server type are you trying to use?
  10. do you still have a problem or error with your code after all this time? you should probably post your current code as well.
  11. did you look at the 'view source' of the output from the above statement in your browser and make sure it is correct? it's likely missing a /
  12. it also looks like you have a few hundred empty entries, possibly from a search engine indexing your site. your form processing code isn't even checking if a form was submitted, nor validating that there is non-empty data, before inserting it into your database.
  13. do you have php's error_reporting set to E_ALL and display_errors to ON so that php would report and display all the errors it detects?
  14. it's possibly a fatal php runtime error (memory/time limit) and if php terminates and error_reporting/display_errors isn't on, a http 500 status will be returned to the browser. set php's error_reporting to E_ALL and display_errors to ON to see if php is detecting any errors that would help identify the problem.
  15. this - if ($pn == 1) { $centerPages .= ' <span class="pagNumActive">' . $pn . '</span> '; $centerPages .= ' <a href="' . $_SERVER['PHP_SELF'] . '?pn=' . $add1 . '">' . $add1 . '</a> '; would become - if ($pn == 1) { $centerPages .= ' <span class="pagNumActive">' . $pn . '</span> '; $_GET['pn'] = $add1; // set $_GET['pn'] to the value you want in the link $qs = http_build_query($_GET, '', '&'); // produce the url query string with all existing $_GET variables $centerPages .= " <a href='?$qs'>$add1</a> "; // build pagination link
  16. you would need to post what you tried to narrow the problem down.
  17. and the processing code would simply be - // define the products (somewhere) $products['gv2000s'] = array('description'=>''); $products['gvb2000'] = array('description'=>''); $products['gv3000s'] = array('description'=>''); $products['gvb3000'] = array('description'=>''); $products['nv300'] = array('description'=>''); $products['bb3000'] = array('description'=>''); if($_SERVER['REQUEST_METHOD'] == 'POST'){ if(!isset($_POST['chk'])){ echo 'No products were picked.'; } else { foreach($products as $key=>$value){ if(isset($_POST['chk'][$key])){ // a checked checkbox was found, use the submitted quantity any way you want. $model = strtoupper($key); echo "You picked Qty: {$_POST['qty'][$key]} of Model $model<br>"; } } } } where i am just echoing the qty/model, you would validate and store the submitted values to be inserted into your database table and put into the email.
  18. and to get you started, here is what all that mass/mess of posted html would look like - <?php // define the products (somewhere) $products['gv2000s'] = array('description'=>''); $products['gvb2000'] = array('description'=>''); $products['gv3000s'] = array('description'=>''); $products['gvb3000'] = array('description'=>''); $products['nv300'] = array('description'=>''); $products['bb3000'] = array('description'=>''); $i = 1; // incrementing value for dom id's foreach($products as $key=>$value){ $model = strtoupper($key); echo "<div class='ship-wrap'> <div class='checkbox'> <label for='chk-$i'><input type='checkbox' name='chk[$key]' id='chk-$i' /> Model $model</label> </div> <div id='quantity-$i' class='quantity'><label for='qty-$i'>Quantity: </label> <select name='qty[$key]' id='qty-$i'> <option value='1'>1</option> <option value='2'>2</option> <option value='3'>3</option> <option value='4'>4</option> <option value='5+'>5+</option> </select> </div> </div>"; } ?>
  19. i realize this reply doesn't directly address the problem, but you have too much hard-code logic, repeated for each product that has been added, and in the case of some of the products, wasn't added correctly. i doubt anyone is going to try and find in your 200+/1600+ line files why some of the data isn't doing what you expect. you need to GREATLY simplify your logic by letting the computer do the repetitive work, not you. you should have a list of product information stored somewhere (database table/array) and you use this information to dynamically produce your form. your form would use array(s) for the fields. this would allow you to use array functions (a foreach(){} loop) to process all the submitted data in the same way. nothing would get left out because all the submitted values, no matter how many of them there are, will be processed by the looping code. i would estimate all your code added together could be reduced to less then 200 lines and adding, subtracting, or changing any of the product information would take place in the database table/array where you have defined it, not by editing the actual logic in your code.
  20. are you sure that's your actual code that you need help with? $query in the last posted code is your sql statement. $result is the value from the mysql_query(). there's no way that mysql_num_rows($query) or mysql_fetch_assoc($query) will work. you should be copy/pasting your actual code so that there isn't a run-a-round about what you are actually asking help for. a SELECT query that runs without any errors, returns a result resource that you can then use in other database statements. a SELECT query that fails due to an error (connection problem, permissions problem. table/column name problems, sql syntax problem, ...) returns a boolean false value. you must always test if a step in your code works or fails before trying to use the result from that step. to debug why your query is failing (assuming you are using all the correct variable names in the right places), use the following when running your queries - $result = mysql_query($query) or die("Query failed: $query<br>Error: " . mysql_error());
  21. if your last post means to have the user information in one table and the donation information in another, the answer is yes.
  22. you seem to have figured out how to post images in the new thread you started for an existing problem. marking this thread solved for you....
  23. you would INSERT a new record for each donation, with the user_id of the person who make it, along with the amount, and date. to get the sum for any user(s), you would simply GROUP BY the user_id and use the SUM() Aggregate function.
  24. i finally figured out what your question/problem in this thread actually means, based on what you are trying to do in your other thread. most shared web hosting only permits you to create a database through your hosting control panel and require a specific naming scheme to avoid conflict with the other accounts.
×
×
  • 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.