Jump to content


  • Posts

  • Joined

  • Last visited


Profile Information

  • Gender
    Not Telling

digitalgod's Achievements

Regular Member

Regular Member (3/5)



  1. you can either find a hosting company that already offers that service or you can get your own VPS and install it yourself, which by the way isn't a very easy install...
  2. well got it work by populating an invisible list box and grabbing those values, not exactly the best way but if anyone has a better proposition please let me know!
  3. you mean .flv right? you need a server that has ffmpeg installed and a few other codecs
  4. also how can I collect the information for the user created drop down? Should I just use ajax and store it in a temp table until the form is submitted or..?
  5. hmm well what I meant was processing the form here I'll give you an example of what the form looks like <form name="newcatalog" id="newcatalog" action="" class="forms" method="post"> <h2>Question 1</h2> <li> <label for="title">Question<em>*</em></label> <input type="text" name="title" id="title" class="text" /> </li> <div id="multiple_categories"> <li> <label for="multiple image categories">Multiple Image Categories</label> <input type="checkbox" name="categories" id="categories" /> </li> <li id="add-categories" style="display:none"> <label for="multiple image categories">Add Categories</label> <ul id="browser" class="filetree"> <?php display_categories(); ?> </ul> </li> <li id="categories-added" style="display:none"><label for="Categories Added">Categories Added</label> <select id="all_categories" name="all_categories" multiple="multiple" height="5"> </select> </li> </div> <li> <label for="Create Drop-Down">Create Drop-Down</label> <input type="checkbox" name="dropdown" id="dropdown" /> </li> <li> <label for="Add value">Add value</label> <input type="text" name="addToDropdown" id="addToDropdown" /><a href="#"><img src="images/add.gif"></a> <select name="dd_values" id="dd_values"> </select> </li> <li><label for="submit"></label> <button name="add" id="add">Add another question</button><input class="submit" type="submit" value="Create catalog"/> </li> </form> For now when a user adds a category it goes in all_categories for him to see and when he adds an option for the drop down it goes in dd_values. I need to be able to collect all of that information for several questions (depending on how many questions were added) So how should I collect all that information?
  6. Ok this might be a bit hard to explain but it I'll give it my best shot! I have a panel where a user can create questions, and he can add as many questions as he wants. Each question has the option to include images as answers, those images are taken from categories, so for example a user can choose to include these categories; carpet, wood, stone. He can also create his own drop downs for each questions by simply typing whatever value he wants and it will add itself. All this is already done, the user can simply press on Add Another Question and fill it up again, my only problem is how to collect all of that data. I could make all of the elements arrays but I don't think that would work because I still need to collect all of the image categories for each question as well as all of the drop down (if a drop down is created ) entries for each question. I just need help with the logic behind all of this, I can't collect all of the information for 1 question quite easily but when more questions are added I'm not exactly sure how to collect them.
  7. it still doesn't work, I'll try to figure it out later on, I'll put it on my to do list. thanks for your help akitchin!
  8. thanks for the tip! Here I'll show you what I mean by unnecessary markup: <ul id="browser" class="filetree"> <li><span class="folder">main</span> <ul> <li><span class="folder">sub-main</span> <ul> <!-- unnecessary --> </ul> <!-- unnecessary --> </li> </ul> </li> <li><span class="folder">main #2</span> <ul> <li><span class="folder">test #2</span> <ul> <li><span class="folder">test #4</span> <ul> <li><span class="folder">test #5</span> <ul> <!-- unnecessary --> </ul> <!-- unnecessary --> </li> </ul> </li> </ul> </li> <li><span class="folder">test #3</span> <ul> <!-- unnecessary --> </ul> <!-- unnecessary --> </li> </ul> </li> </ul>
  9. thanks akitchin! I've always hated recursives... my only problem though is that it creates unnecessary markup ( I'm a neat freak as well as a web standards freak hehe) but I've lost so much time trying to get those damn <ul> tags to close at the right place that I don't really mind. One question though, is there a way to keep the generated markup nice and clean, because right now it prints everything on one line and adding \n isn't helping...
  10. anyone? I'm really going crazy trying to get this function to work
  11. hey ignace, that actually won't echo out anything because main folders have no parent_id so they're parent_id value is 0 if that makes any sense... That's why I had $level, to keep track of how deep it goes in one branch that table image_category has image_category_id | parent_id | title | description | created
  12. hey guys, I'm trying to build a recursive function to display all of my categories and subcategories but I keep running into some logic problems... what I basically need it to do is echo something like this <li><span class="folder">Folder 1</span></li> <li><span class="folder">Folder 2</span> <ul> <li><span class="folder">Subfolder 2.1</span> <ul id="folder21"> <li><span class="folder">Subfolder 2.1.1</span></li> </ul> </li> <li><span class="folder">Subfolder 2.2</span></li> </ul> </li> so main folder that don't have any children are between <li></li> tags, folders that do have children have <ul></ul> before the closing </li> I can't figure this out and I know it shouldn't be that hard but it's getting late and I'm extremely tired... this is what I have right now and it's no where near what I want it to do function recursiveTree($parent, $level) { $result = mysql_query('SELECT * FROM image_category '. 'WHERE parent_id="'.$parent.'";'); $result_count = mysql_num_rows($result); // display each child while ($row = mysql_fetch_array($result)) { $new_level = $level + 1; if ( $new_level == 1 ) { echo '<li><span class="folder">'.$row['title'].'<ul>'; } else { echo '<li><span class="folder">'.$row['title']; if ( $result_count == 1 || $result_count == $new_level ) { echo '<ul>'; } else { echo '</li></ul>'; } } recursiveTree($row['image_category_id'], $level+1); } }
  13. hmm I see what you mean, makes perfect sense. here's what I've been doing $sql_clients = "SELECT * FROM client"; $result = mysql_query($sql_clients); $clients_count = mysql_num_rows($result); if( isset($_GET['a']) && isset($_GET['id'])) { $action = stripslashes(mysql_real_escape_string($_GET['a'])); if ( $action == "del" ) { $cid = stripslashes(mysql_real_escape_string($_GET['id'])); $sql_delete = "DELETE FROM client WHERE client_id = '$cid'"; $delete_result = mysql_query($sql_delete); $sql_delete2 = "DELETE FROM client_address WHERE client_id = '$cid'"; $delete_result2 = mysql_query($sql_delete2); } } so I guess I should just switch them around instead. edit works perfectly, thanks!
  14. hey guys, I have a script where users can add/remove clients, my problem is that when a person clicks on delete, the page refreshes, the row gets deleted from the db but it still shows that client in the html table, the info will disappear only after a page refresh. I'm pretty sure it's a cache problem but I have no idea how to fix this.. any suggestions would be greatly appreciated!
  15. thanks accident, can't believe I didn't see that... note to self, sleep more!
  • 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.