Jump to content

ToonMariner

Members
  • Posts

    3,342
  • Joined

  • Last visited

Everything posted by ToonMariner

  1. did mutley wee on them? can we have some code - html and css. which browser you were viewing etc etc.
  2. ??? Example - client wanted a div positioned absolutely at the bottom of another div. All browsers complied except safari and IE 5.5 and less.  By placing the div just below the what was intended to be its parent solved everything - withoud using some relative position it leaves a slightly longer gap after the main content area - but not so that you'd cry - a little compromise has brought that particular aspect of the site into a consistent display on ie5+ opera, safari firefox etc.
  3. its ok by me julian! I very much prefer to break out of php when formatting html - only keep html in echo statements when there is very small amounts of html to do. OK Its a little confusing what you wish to achive BUT just to be clear this is what I think you are trying to do. You show a table of tours and in that table you show which packages have that tour. The you want the users to select which packages they want. [code] <?php $tour = "SELECT * FROM `tours` WHERE `tour_id` = " . $_GET['tour_id']; $tour = mysql_query($tour); $tour = mysql_fetch_assoc($tour); $pack = "SELECT * FROM `packages` WHERE `package_id` IN (. $tour['packages'] .)"; $pack = mysql_query($pack); ?> <table width="530" border="0" cellspacing="0" cellpadding="5"> <tr> <td class="tourtitle"><?php echo $tour['title']; ?></td> </tr> <?php while ($row_package = mysdql_fetch_assoc($pack)) { ?> <tr> <td> <label> <input type="checkbox" name="id_packages[]" value="<?php echo $row_package['id_packages']?>" /> <?php echo $row_package['name']?> </label> </td> </tr> <?php } ?> </table> [/code] I think that should do the trick.
  4. if you are using keys then this process should never bee required - keys are there to help you link things together - every record in a table (where that record is a foreign key in another table) should have a uniquie key and as such you should use primary key with auto_increment.
  5. becareful validating form elements. Using isset is a bit of a red herring - posting empty fields still SETS that var name in the postheaders. empty will return true (ie will detect an empty var) if your var is set to 0 - you may want 0.... I tend to use type casting when validating forms - I find it helps.
  6. The above script will never select the correct value asyou have checked= hardcoded. Now I am one for the standards so checked="anything" should not make the browser check the radio button.... not tried it but I bet it does.... here is what you need [code]<?php $query = "SELECT sex FROM members WHERE user_name='$username'"; $result = mysql_query($query) or die ("could not find sex"); $row = mysql_fetch_assoc($result); if (strcmp($row['gender'], 'male') == 0) { $mcheck = ' checked="checked"'; $fcheck = NULL; } else { $mcheck = NULL; $fcheck = ' checked="checked"'; } ?> <label><input name="info_sex" type="radio" value="male" <?php echo $mcheck; ?>/>Male</label> <label><input name="info_sex" type="radio" value="female"<?php echo $fcheck; ?> />Female</label> [/code] There is something wrong with your logic there. Repeating a query is a waste of resources. $row = mysql_fetch_array($result); $row['sex'] = $gender; That code seems to completly wipe out the value you have just queried - $gender is not set before this piont! I really don't want to offend you Jesie but you don't half look like Heather Brooke... sorry but you do ;)
  7. not with html - you could flip you array so that it would let you enter the details ltr then ttb!
  8. you will note that the forum login script includes a session id after the action of the form (take a look at the source code). You will either: a) edit the forum so that session is only started once user has logged in or b) start a session on the staff login page and append the session id to the end of the action="http://forums.blah/blah/login.php?sid=ddca900783a48053c07394f5d5c64222" Now that session id looks like an md5 hash of the actual session id - you will have to see how the code of teh forum generates this value and replcate it on your staff ligin page.
  9. ToonMariner

    overflow

    can a td element have a scroll bar? a div definitely can so why not use one there?
  10. you should ,unless absolutely neccessary (when would that be?),  leave ALL your styling to an external css file - it makes maintaining your site VASTLY simpler.
  11. [code]<?php $string = '<p>massive <a href="here">long</a> piece of <strong>text</string> that is never gonna fit<p>'; $strarr = explode(' ', strip_tags($string)); $max = 40; $max_words = count($strarr) > $max ? $max : count($strarr); $newstr = NULL; for ($i = 0; $i < $max_words; $i++) { $newstr .= $strarr[$i] . " "; } echo "<p>" . $newstr . "</p>"; ?>[/code]
  12. Ah I understand. You are wanting to take them to a page that shows what they are about to delete and then confirm. In that case the correct mark-up would simply be a link - not a button. simply place some vars in the url. <a href="/path/to/file/delete.php?record=77" title="Delete Record 77">Delete</a> <a href="/path/to/file/delete.php?record=78" title="Delete Record 78">Delete</a> <a href="/path/to/file/delete.php?record=79" title="Delete Record 79">Delete</a> Then delete.php can show the stuff and have a confirmation button at the bottom which when pressed will do the delete.
  13. can I make a suggestion.... don't use a button for each record - use a check box aginst each record and ONE submit button at the bottom of the form... <input type="checkbox" name="delete[]" value="77" /> <input type="checkbox" name="delete[]" value="78" /> <input type="checkbox" name="delete[]" value="79" /> this makes your code in the next page even easier. sice these are checkboxes they only get a value if they are actually checked - otherwise html pretendsw they never existed. In the processing script you can now delete multiple records all with one query like so. [code]<?php $ids = implode(',', $_POST['delete']); // this will make a comma separated string of all the delete checkbox values. $qry = "DELETE FROM `a_table` WHERE `id` IN (" . $ids . ")"; $qry = mysql_query($qry); ?> [/code]
  14. I switched to table-less layouts about 2 and a bit years ago. The only time I use a table is to display tabulated data. I have changed my design approach (not graphics - I can't drive photoshop to save my life - seriously a drop shadow is a major achivement for me ;) ) to the extent that in the last 12 - 18 months I don't remember using any css hacks to get my sites having the same feel in ie, ff, opera and (of late I might add) safari. I don't bother with other browsers apart from amaya - which I just use to see what my sites will look like in years to come ;). The reason for this is that in order to make your sites as usable as possible on as many platforms/devices as possible is that you HAVE to compromise somewhere.  Where? Standards compliance -  although 'compromise' is so far away from the right term there; the real term is probably more like awakening - from the land where tables were teh dominant gene and seeing past them was impossible because of teh sheer mass of junk html needed to maintain their presence. I have found that adopting a standards compliant method actually reduces the development time for sites - I am sure those who have made the switch will agree. Many ignore the importance of the doc type declaration and what that can do for you. (If you are un-aware google 'doctype switching'.) I now exclusivle design in strict xhtml 1.1 and validate my code. According to bobby/webxact my recent sites have all met the wca priority 3 checkpoints (the automatic ones - manual check points are compliant but only my word for that!) Clients are much happier getting something for 'nothing' and while most are unaware of accessibility issue and whether it applies to them, or the mechanisms in getting a good search engine rating etc. etc. they quickly see the benefit of having these on there site with minimal sacrifice on design (ok some but very little) and more importantly cost. It is far cheaper to build and maintain one site that serves the web, mobile phones, hand held pcs, screen readers, braille devices etc etc. than creating something for each. Standards allow you to achieve this - without a table in sight unless you WANT to use one not NEED.
  15. one is 'dynamic' and the other "isn't" DHTML is basically html combined with css and javascript to make a page that are 'dynamic' [url=http://www.w3schools.com/dhtml/default.asp]http://www.w3schools.com/dhtml/default.asp[/url] This is of course a load of cod's wallop - use css and javascript should NOT be a prerequisite for your site to function. CSS and javascript are used on plenty of pages so you COULD call all of those pages dhtml. DHTML is NOT a language like html - it is the use of three separate technologies together to create highly interactive web pages.
  16. OK those urls don't work. I would understand you trying to hide yur site away but just incase you are not www.domains.org.uk redirects to www.domainit.com. and the links to teh subdomains simply don't work. if those are not the actual domains you are working with then come back and post some url that we can use (maybe put up a temp site somewhere? or if its not critical the actual url you are working with)
  17. Sorry didn't read his initial post (being lazy - unlike me ;) ) and yes yo0u are correct you don't need two actions for that - the script thatprocesses teh data can query the database for insert/update and then send out the e-mail - no need for two actions.
  18. errrr..... I didn't understand that. Can you put that in plain english please... ta very much.
  19. $update = "update `videos` set `clicks` = `clicks` + 1 where `vidid`= '".$id."'";
  20. you mean the mod rewrite stuff.... [url=http://www.alistapart.com/articles/succeed/]http://www.alistapart.com/articles/succeed/[/url] OR you can configure apache to get php to parse any file extension you like I think it is this line in your httpd.conf file for apache AddType application/x-httpd-php .php change the .php to what ever extension you like and it will parse it.
  21. comment out the header and echo out the query. add the 'or die(mysql_error())' to teh mysql_query and see what goes wrong.
  22. try calling using absolute paths (I tend to place $_SERVER['DOCUMENT_ROOT'] first and then teh full path from my root. This makes the function much more extensable.
  23. tinyMCE is IMO option the most customizeable wysiwyg editor - only draw back is that they ahev made it 'cross browser' friendly by including if staements every where instead of compartmentalizing the code into direcotries and just using the one set of code for each browser. This makes it quite big and hence slows down your page. If that is an issue then perhaps look at FCKEditor - similar vein but I personally prefer tiny. Dead easy to implement you just need rudamentary skills in creating you html form and processing the results.
  24. its called an image map and its html not css
  25. I used one in a cms - one form 2 jobs - action one was to a script to show a preview of what page would look like and action 2 was to commit to the database.
×
×
  • 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.