Jump to content

Omzy

Members
  • Posts

    314
  • Joined

  • Last visited

    Never

Everything posted by Omzy

  1. I could have a go at building it myself, but surely there must be one out there already? Just something simple that can be adopted for different uses.
  2. I'm creating a website for my friend's car business using PHP 5.2 with MySQL. I would like to provide him with an easy to use interface where he can log in and add/delete/modify stock. There also needs to be a facility to add multiple images. There is no e-commerce facility required. Now I've looked at two options so far: 1) phpmyadmin - this would be too complex for my friend and does not provide facility to add images 2) Joomla using virtuemart extension - this is more geared towards an e-commerce site and although you can disable the e-commerce functions it's still not ideal for showcasing cars. I also came across a script here: http://real-estate-management-software.org/ - the only problem with this it seems to be written in PHP4 and I could not get to to work on PHP5 at all. Otherwise that would have been a perfect solution - it's nice and simple and although it's designed for properties I could easily modify it for cars. So I'm looking for a free solution to this - anyone have any suggestions?
  3. So, any1 have any more suggestions?
  4. That didn't work I'm afraid... Still the same error.
  5. Hi webster, Many thanks for providing that solution. I'm going to implement that shortly. Just a small issue - if the user, for whatever reason enters a non-existent hash value in the URL, it brings up an 'empty' tab and none of the other tabs work: Error: document.getElementById(tabber) is null Can you include some code that will default to the first tab if a non-existent hash value is entered in the URL? (just to cover all angles)
  6. Right my webhost has just advised me that SSH tunelling isn't allowed on their servers...
  7. Thanks webster08 Can't this be done using standard JavaScript?
  8. At one point I was resigned to having my PHP scripts connect remotely to the live database, and that way I would only need to maintain one copy of the database. However I then realised my webhost (like most others) doesn't allow remote connections to the database. I've now come across this article which talks about SSH tunelling: http://chxo.com/be2/20040511_5667.html Has anyone tried this and would this be the best option for me?
  9. Basically I have a development environment set up on my localhost server (on my machine) so I can test new changes before uploading to the live server. This means that every time I update something in my local database I have to create a sql dump, then import this in to my live database - which is rather tedious. So, I have two questions: 1) Is there a script I can create which sends the sql dump query (HTTP_REQUEST perhaps?) to a script on the live server, which then inserts this data in to the live database? 2) Can you create a sql dump query that won't overwrite data that already exists in the database, but instead just updates any data that has been changed/removed/added?
  10. I want to create JavaScript content tabs based on a div/ul structure. Each tab should be a hyperlink in the form of a bookmark link (#), you should then be able to type in the bookmark url and be taken to that specific tab. Just like this site does: http://validator.w3.org/#validate_by_input
  11. Well I think all the info that is needed is in that one post. I thought I could implement Crayon Violet's solution into this piece of code - the only functional thing that differentiates this piece of code from the first one is that this has a foreach loop within a foreach loop. Essentially what this code is doing is outputting a list of 'child' values that match it's 'parent' value.
  12. Cheers for that. Do you know how I can implement your solution in the below code: foreach($_POST['selection'] as $value) { echo ''.$value.''; foreach($_POST['tags'] as $index1 => $value1) { if($value1 == $value) { echo ''.$subcats[$index1][2].''; } } } So basically I need to replace the line: echo ''.$subcats[$index1][2].'';
  13. Thanks, Crayon Violent. That works perfect. How do you think my code could be improved though?
  14. Let's say I have code as follows: foreach($cat as $index => $value) { if($cat1 == $index || $cat2 == $index || $cat3 == $index || $cat4 == $index || $cat5 == $index) { echo ' <a href="/directory/'.$index.'/">'.$value[2].'</a> '; } } This code will output UP TO 5 hyperlinks in one line, depending on which, if any values exist in the array. For example: Item1 Item2 Item3 Item4 Item5 I now need to present this in a better form, as follows: - Item1 | Item2 | Item3 | Item4 | Item5 The '|' separator should not appear after the last item, and it should not appear if there is only one item. The '-' seperator should only appear before the first item, if one exists. How do I do this?
  15. Why does this not work: $subcats=array( 'wedding-cakes'=>array('cakes', 'Wedding Cakes'), 'birthday-cakes'=>array('cakes', 'Birthday Cakes') ); $cat=array( 'cakes'=>array('Cakes', 'Wedding Cakes, Birthday Cakes') ); foreach($subcats as $index1 => $value1) if($subcats[$index1][0] == $cat) { //echo $subcats[$index1][1]; }
  16. Here is my current address string: $address=$address1.", ".$address2.", ".$district.", ".$town.", ".$county.", ".$postcode; The problem is sometimes a client does not provide an 'address2' or 'district', in some cases both are not provided in which case the address string has unnecessary comma's in. How can I get around this problem?
  17. function goto(url) { var selection = document.getElementById('region'); if(selection.value != null) { document.location = url + document.getElementById('region').options[document.getElementById('region').selectedIndex].value; } } <a href="/directory/'.$index.'/" onclick="goto(this.href); return false">'.$cat[$index][2].'</a> 'region' is a drop down box (HTML SELECT). What the function does is append the current value of 'region' to the end of the URL specified in the 'a href'. It does this onclick (not onpage load). I was wondering could the same functionality be achieved using PHP? Perhaps using the header() function?
  18. Wow that has worked! I think I finally have a working solution and this can be marked as 'solved' for the final time! Thanks once again! ;-)
  19. Basically the code is as follows: The $errors array that checks the number of boxes checked: $max=3; $errors=array(); if($_POST['selection'] == null || count($_POST['selection']) > $max) { array_push($errors, 'selection'); } The checkbox function: function checkBoxError($fieldName, $value, $key) { $theField = $_POST[$fieldName][$key]; if(in_array('selection', $GLOBALS['errors']) && $theField == $value) { return 'checked="checked"'; } } The code to display the error message: if(in_array('selection', $values)) { if (count($_POST['selection']) > $max) { echo '<p><b class="red">You selected '.count($_POST['selection']).' categories. Please select up to '.$max.' categories only.</b></p>'; } The checkbox: <input type="checkbox" name="selection['.$j.']" value="'.$cat[$index][2].'" id="'.$index.'" '.checkBoxError('selection',$cat[$index][2],$j).'/>'.$cat[$index][2].''; The $cat array: $cat=array( 'music-video'=>array('3', '0', 'Music & Video', 'Music & Video') );
  20. Hi, Yes that actually works. But if I use '&' rather than '&amp' it doesn't validate as XHTML 1.0 Strict. And I need to use this doctype for this project. Any more ideas?
  21. chronister - it seems that it doesn't work with checkboxes who's value includes '&' Not sure if its the '&' or the ';' it is not liking. Can you investigate?
  22. Nope not using sessions. Actually I think it's working now, I have moved the $j=0 variable into the outermost FOR loop (it's a messy FOR-FOREACH loop), everything seems to be fine now. Thanks!
×
×
  • 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.