Jump to content

programguru

Members
  • Posts

    133
  • Joined

  • Last visited

    Never

Everything posted by programguru

  1. I actually had luck echoing it to the page, but I could not get it to print in the email????? $while_full_result=''; while(list($key, $val) = each($_POST)) { $while_full_result .= "<tr><td>$key</td><td>$val</td></tr>"; } $message = "<table>$while_full_result</table>"; echo $message; // Mail it mail($to, $subject, $message, $headers);
  2. o3d, Thanks. Worked like a charm. I guess I have a lot to learn with this specific type of loop, because I can't get this to work with my table output structure now. It's only echoing the key value pair from the form: $while_full_result=''; while(list($key, $val) = each($_POST)) { $while_full_result = "<table border=\"1\">"; $while_full_result .= "<tr><td>$key</td><td>$val</td></tr>"; $while_full_result .= "</table>"; } $message = $while_full_result;
  3. I am simply trying to store the full results of my while loop in a variable to store into a variable for a mail() script I am writing. while(list($key, $val) = each($_POST)) { "<strong>$key</strong> => $val<br />"; } $message = $while_full_result; echo $message; This should echo the same output as the while loop natively does. But I cannot get this to work properly. Thanks for any advice.
  4. That's a security feature. If you're processing data from your db for output using php, and if your .ini is not configured to handle it, then try something like: http://www.php.net/stripslashes
  5. have a situation where I have a specific website I am working on. Select the category, sub-category, then product. The product page loads very slowly for some reason. Even if there are not images on the page its just dragging. No other sites on the same server are having this issue. My supsicions are: --MySQL connection speed --MySQL data loading There are multiple form fields being populated. Does anyone know of a script for the actual page which I can test the speed of the MySQL query when the page loads?
  6. Yes! I was recommended this as well from some David Sawyer writings.. Ok think it's my best bet.. Thanks!
  7. Hello, I was looking for any tips on a very flexible, validated, and stable drop-down menu system script (free or fee OK). Preferably css/js, and easily integratable with php. Max 3 level deep capability: Level 1 (root) -------- Level 2 --------- Level 3 I am using a few homemade concoctions now, but are just a pain to maintain. SOS
  8. Can anyone see an issue with this causing the parse error. Am I losing my mind!! Parse error: syntax error, unexpected ',' in D:\mydirectory\product.php on line 5 <?php class Product extends AppModel { var $name = 'Product'; var $belongsTo = array('Dealer' => array('className' => 'Dealer', 'conditions'=>, 'order'=>, 'foreignKey' => 'dealer_id')); } ?>
  9. I see how that would work and why now my method was totally bunk. Nice logic.
  10. Hmmm... I don't see an out on this, but was wondering if you know of a function or method to do this business: My script works perfect with the exception of my empty() function, because I see the date() function creates a value regardless if my field $date_start (from my table) is in fact empty. I'm just trying to echo nothing if the value of $date_start is NULL (blank). Any ideas where to look on this one? .... $date_start = $row['date_start']; $date_end = $row['date_end']; $date_start_converted = date("M jS, Y", strtotime($date_start)); $date_end_converted = date("M jS, Y", strtotime($date_end)); if (empty($date_start_converted)) { $date_start_converted = ""; } ....
  11. Vedy nice. I did not know that function strtotime() existed!! Thanks for the tip.
  12. Without writing a full blown explode() script, does anyone have any ideas as how to: Convert format: 03/05/2009 to Mar 5th, 2009 I tried several variations of date(), but think it's not a proper function for this conversion. Any ideas?
  13. Cool thanks I was able to dig up a few tuts with the curl() functions.. will take a while to get my hands around this one!
  14. Hello, Is it possible to "fetch" variable content details from an external website with php? For example, if I wanted to create a custom ebay log of my for-sale items with my own custom interface (I know I would probably not be able to alter the data) and on a different domain name. Is this possible with php? And if so, does anyone know the correct technical term for this and possible an example or tutorial you can link me up to? Thanks for any advice on this.
  15. premiso, i did not realize mysql had that function as well! that worked perfect.
  16. does anyone have an idea on selecting random records.. my code is working fine as is. as you can see my mysql query is limited to 3 WHERE featured=1, but it's possible i will have 20-30 featured records. i tried variations of php rand() and its family with no luck.. any ideas? ... $sql = "SELECT id, date_added, date_start, date_end, title, spaw1, featured FROM $table_name WHERE featured=1 ORDER by date_added LIMIT 3"; $result = mysql_query($sql) or die(mysql_error()); while ($row = mysql_fetch_array($result)) { $id = $row['id']; $date_added = $row['date_added']; $date_start = $row['date_start']; ...
  17. i was thinking there might be a query that would do that.. but again you beat me to it! thanks for the advice.
  18. i see what you mean.. the results are perfect now, but i just need to limit the results to a max of 3 less than or equal to 3... messing around with that now, and more errors if you have any idea on this, please feel free to throw your advice
  19. genericnumber1, thanks for the insight.. i feel like a moron after 3 hours or trying to figure this out.. 4 <= 4 man what was I thinking! still learning... im going to test it in the am, but was this is what you mean? ... $result = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_array($result); while ($row = mysql_fetch_array($result)) { $id = $row['id']; ...
  20. i cannot get my results to be 4 or less, and i don't know why my script will not do this! all i can get it to do is print one record when it should be printing up to 4 that meet my criteria as you can see in my mysql query. // test featured only list $table_name = "special"; $bd_string_featured = "<table> <tr> <th>Date Added</th> <th>Date Start</th> <th>Date End</th> <th>Title</th> <th>View</th> <th>Edit</th> <th>Delete</th> <th>Featured</th> </tr> "; $sql = "SELECT id, date_added, date_start, date_end, title, spaw1, featured FROM $table_name WHERE featured=1 ORDER by date_added"; $result = mysql_query($sql) or die(mysql_error()); $num = mysql_num_rows($result); echo $num; while ($num <= 4) { $row = mysql_fetch_array($result); $id = $row['id']; $date_added = $row['date_added']; $date_start = $row['date_start']; $date_end = $row['date_end']; $title = $row['title']; $featured = $row['featured']; $bd_string_featured .= '<tr> <td> ' . $date_added .' </td> <td> ' . $date_start .' </td> <td> ' . $date_end .' </td> <td><a href="app_view_special.php?id=' . $id . '">' . $title . '</a></td> <td><a href="app_view_special.php?id=' . $id . '">View</a></td> <td><a href="review_edit_special.php?id=' . $id . '">Edit</a></td> <td><a href="javascript:deleteConfirmation(\'app_delete_special.php?id=' . $id . '\')">Delete</a></td> <td>' . $featured . '</td></tr>'; $bd_string_featured .= "</table>"; $num++; } ?>
  21. I should have mentioned I have a way to do this by creating arrays for each "Browse" option, but what I really need to be able to do is: Let's say I have already uploaded 5 images, and I want to add another, I should have a link that says "Add Another Image", and that would create a new Browse box to submit a new image. SO I am beginning to think some type of while array will be the only way to do this, and will also need some javascript to control the dom Browse div box... Still seeking answers...
  22. So far I have gotten my script to the point of uploading 1 image. I would like to extend this per transaction to: 1) Upload unlimited images (disregarding server limits). 2) Manage the uploaded images (edit/delete). 3) Position the images in linear format for UI display. Does anyone have a recommendation on a tutorial, or other documents that cover this specifically? Or your own ideas on where to start with this?
  23. I hate globasl! But I added a & (reference) to the front of that the var that was not outputting and now it is: function globalEcho() { echo "&$table_name"; } Globals are bad. I don't think you get it. i don't get a lot of things
  24. thorpe, that did work! and you are right. it does not make much sense as i am normalizing my db data. so maybe i went all this way for really no good reason! however, i just realized i can just define all my tables in the costants, so i can still keep it all in one place. im not sure how this applies to viewSpecialsUi(): "Though really, functions are most useful when they simply return result and not echo them." do you mean the function output should be returned as opposed to echoed like: echo "<p>There are no records to display.</p>";???
  25. mastermind my last post!! it was adding the & onto the function that was outputting.
×
×
  • 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.