Jump to content

envexlabs

Members
  • Posts

    256
  • Joined

  • Last visited

    Never

Everything posted by envexlabs

  1. Hey, I have a list of tags that are rendered out of a mySQL database. Beside each tag is a checkbox, that a user can use to choose 4 tags. How would i go about limiting the user to only checking 4. I've found a few scripts, but they are all for static checkboxes. Thanks, envex.
  2. Hey, I know how to redirect, but the form is being processed half way down the page, after all the header has been rendered.
  3. Hey, I know how to redirect using header(), but i have a quick question. I know that you have to send the redirect before all the header information, but if i have a form being processed halfway down the page via, $_SESSION[php_self], how do i go about redirecting after the form has been processed? Thanks, envex
  4. Thanks for trying I guess i'll keep searching, or wait for someone to help! envex
  5. That would overwrite whatever the user has previously written though. It's kinda like a WYSIWYG editor, but an extremely simple version.
  6. Hey, Pretty much yeah. I want the user to do this: <textbox> "I'm writing a newsletter cause i'm awesome" User clicks a product button, and the product is added. "I'm continuing to write my newsletter!" </textbox> If that makes sense
  7. Hey, I have a textbox, where a user can write out a newsletter type deal. I also have a list of products, that when the user click on it, it grabs all the info from the database and neatly generates html for the product. I can deal with grabbing from the database and formatting, but i need some help with on click insert into the text box. Anyone have an idea? Thanks, envexlabs
  8. Hey, I have a form that a user submits which creates a product. I want the user to be redirected to product.php?product_i=(the new product id) The problem i'm having is that i dont know the ID of the new product created because the table is set to auto increment. How would i go about finding out the new ID and redirecting to that new product after it has just been created? Thanks, envex
  9. Hey, I've figured it out: if($_POST[submit] == "true"){ $tag = $_POST['tag']; foreach ($tag as $tagid) { //inserts the chosen tags into the database $insert_tags_query = mysql_query('INSERT INTO `store_tags` (`store_id`, `tag_id`, `order_id`) VALUES (\'' . $au[member_id] . '\',\'' . $tagid . '\',\'0\')'); } }else{ //do nothing } I am, however, back to my original problem. Javascript wont work because each checkbox doesn't have a unique ID. Anyone know a work around to this? Thanks, envex
  10. Hey, I have encountered another problem. When I post the form, this is what i get when i print_r($_POST): Array ( [tag20] => on [tag81] => on [change_tags] => true ) How can I figure out, out of 200 tags, which 2 have been chosen, because the $_POST[tagx] will change depending on which tags are chosen?! Thanks, envex
  11. Thanks for the suggestion, i would want it to be a real time thing though, will look into the JS! Thanks again
  12. Also, just a little tip: $updateplayerstats="Update dragusers set credits=credits-'$gold', engine='$engine', car='$name' where username='$username'"; mysql_query($updateplayerstats) or die("Could not update players car"); is the same as: $updateplayerstats=mysql_query("Update dragusers set credits=credits-'$gold', engine='$engine', car='$name' where username='$username'") or die("Could not update players car");; just saves a line of code
  13. Hey, I have a function that renders out tag categories, and then all the tags within said category. Each tag has a checkbox beside it, i am wondering if it's possible to only allow a user to check 4 tags. Here is the function: $select_tags_query = mysql_query('SELECT * FROM `tag_category`'); while($tag_category = mysql_fetch_row($select_tags_query)) { echo '<div class="tag_cat">'; //renders out the category name echo '<h2>' . $tag_category[1] . '</h2>'; $tags_query = mysql_query('SELECT * FROM `tags` WHERE `cat_id` = ' . $tag_category[0] . ''); //renders out each tag in the category while($tags = mysql_fetch_row($tags_query)) { echo '<p><input type="checkbox" />' . $tags[1] . '</p>'; } echo '</div> <!-- tag_cat div -->'; } This is what is outputs:
  14. Hey, I have a page that renders out a shopping list that a user has created. the shopping_list table reads like this: mem_id | product_id | cat_id --------------------------------- 1 | 2 | 1 1 | 3 | 2 1 | 5 | 1 1 | 4 | 2 1 | 1 | 2 the code that renders out the list is: $grab_lists_query = mysql_query('SELECT * FROM `shopping_list` WHERE `mem_id` = ' . $_GET[mem_id] . '') or die(mysql_error()); //grabs all the lists, and renders them out while($all_lists = mysql_fetch_row($grab_lists_query)){ //grabs the list name and renders it out $grab_list_name_query = mysql_query('SELECT * FROM `list_name` WHERE `list_id` = ' . $all_lists[2] . '') or die(mysql_error()); while($list_name = mysql_fetch_row($grab_list_name_query)){ echo'<div class="list_name"> <p class="list_nav"><img src="images/icons/page_white_delete.gif" height="16px" width="16px" alt="" /> delete list</p> <p class="list_nav"><img src="images/icons/printer.gif" height="16px" width="16px" alt="" /> print list</p> <h2><a href="javascript:Effect.toggle(\'' . $list_name[0] . '\',\'blind\');">' . $list_name[1] . '</a></h2> </div>'; //grabs product info $product_info_query = mysql_query('SELECT * FROM `products` WHERE `product_id` = ' . $all_lists[1] . ''); $product_info = mysql_fetch_row($product_info_query); //grabs store info $store_info = select_store($product_info[1]); echo '<div class="list_container" id="' . $list_name[0] . '" style="display: none"><p>'; echo '<img src="' . $product_info[5] . '" height="50px" width="50px" alt="" / class="favstore_img_border">'; echo '<div class="list_content"><h2>' . $product_info[2] . '</h2></div>'; //product name echo '<div class="list_store_name"> <h2><a href="billy.com">' . $store_info[1] . '</a></h2> </div>'; echo '<div class="list_store_info"> <p>' . $store_info[2] . '</p> <p>' . $store_info[4] . ', ' . $store_info[5] . ', ' . $store_info[6] . '</p> <p>' . $store_info[3] . '</p> </div>'; echo '<div class="list_price"><p>$' . $product_info[3] . '</p></div>'; //price echo '</p></div>'; //makes the products draggable for sorting echo' <script type="text/javascript"> new Draggable(\'' . $list_name[0] . '\',{revert:true}); </script>'; } } The problem that i'm having is i want php to grab the lists, and populate each list. What i'm getting right now is: List 1 -Product 2 List 2 -Product 3 List 1 -Product 5 List 2 -Product 4 List 2 -Product 1 What i want is: List 1 - Product 2 - Product 5 List 2 - Product 1 - Product 3 - Product 4 What am i doing wrong? Thanks, envex
  15. Hey, Sorry, it's early in the morning so store a, has chosen the name of boom. user a. likes the store, so he wants to visit it. user a. types in http://www.website.com/boom now, http://www.website.com/boom actually links to http://www.website.com/store.php?id=1 I need to know how to make http://www.website.com/boom point to http://www.website.com/store.php?id=1
  16. Hey, I have a site where a website that the user gets to choose a url, ie. http://www.website.com/myname The way the site is created is the user will actually be pointed to user.php?id=4, but i want the end user to be able to just use http://www.website.com/myname How is this achieved? Thanks, envex
  17. Hey, I'm not to sure if this is what i'm looking for. What i have is a page that renders out all the stores a user has added as favorite. I want to show, if applicable, if a store has updated any of their information.
  18. Hey, the mysql forums are dead, so i thought i'd give here a shot Is it possible to check and see if any mysql tables have been updated. ie. if a store has added new products, etc. Thanks, envex
  19. Hey, Is it possible to check and see if any mysql tables have been updated. ie. if a store has added new products, etc. Thanks, envex
  20. Hey, If anyone here has used aMember Pro before, i have a question for you. Do you know how to use an email as a username? Thanks, envex
  21. Hey, I have a piece of PHP code that is rendering out even and odd classes. this is exactly what the code is outputting: <div class="one"id="233">Once</div> <div class="two"id="235">Two</div> <div class="one"id="234">One</div> The css code is as follows, and it's at the bottom of the css page, so i know nothing is being overwritten: .one{ background: red; font: 3em/1em helvetica, arial, sans-serif; } .two{ background: white; font: 1.4em/1em helvetica, arial, sans-serif; border-top: 1px solid #efefef; padding: 7px 0 7px 5px; } Only the div with class="two" is being effected by the css, the other div="one" is plain. I've gotten the other web designer to take a look at it, and we can't figure it out to save our lives
  22. Hey, I have this query and a function: $search_form_query = mysql_query('SELECT * FROM `products` WHERE `name` LIKE CONVERT(_utf8 \'%' . $_GET[search_field] . '%\' USING latin1) COLLATE latin1_swedish_ci OR `description` LIKE CONVERT(_utf8 \'%' . $_GET[search_field] . '%\' USING latin1) COLLATE latin1_swedish_ci') or die('No results found for "' . $_GET[search_field] . '"'); page_counter($search_form_query); the function: function page_counter($query){ $page_count = mysql_result($query); print_r($page_count); } When i execute the script i get this error: Warning: Wrong parameter count for mysql_result() in /mnt/gs02/herd02/20143/domains/werehavingasale.com/html/inc/php/php_functions.php on line 777 Can i not use a query as a function variable? Any help is appreciated! Thanks, envex
×
×
  • 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.