Jump to content

ToonMariner

Members
  • Posts

    3,342
  • Joined

  • Last visited

Everything posted by ToonMariner

  1. if that is the case then php is not parsing the file. The filename should end '.php' (unless you have configured your server to get php to process other file extensions!) If it is called xxx.php then php is not installed/running on your server.
  2. the align attribute is deprecated for img tags just float the image left or right and the text will wrap accordingly.
  3. [code] <div id="container"> <h1 class="underline">New Callaway Big Bertha <span>(Uploaded on: 17-12-2006)</span?> <div id="images">   <img src="bigimage.jpg" width="xxx" height="yyy" title="blah" alt="driver" longdesc="pathtoitempage.html" /> <ul>   <li><img src="thumbimage[0].jpg" width="xxx" height="yyy" title="blah" alt="driver" longdesc="pathtoitempage[0].html" /></li>   <li><img src="thumbimage[1].jpg" width="xxx" height="yyy" title="blah" alt="driver" longdesc="pathtoitempage[1].html" /></li> </ul> </div> <div id="details">   <ul>   <li><span>Section:</span> Mens</li>   <li><span>Class:</span> Drivers</li>   <li><span>Make:</span> Callaway</li>   </ul>   <ul>   <li><span>Tel:</span> 0876141487</li>   <li><span>Contact Name:</span> Andrew</li>   <li><span>County:</span> Dublin</li>   </ul> </div> <div id="text">   <p>Brand new callaway....</p> </div> <div class="clearb"></div> <h2 class="underline">Price: &euro;400 </div> [/code] css [code] .underline { border-bottom: 1px dashed #666; } h1 { font-size: 0.9em; } h1 span { color: #ccc; font-size: 0.7em; vertical-align: middle; } h2 { text-align: right; font-size: 0.8em } div.clearb { clear: both; } div#images { float: left; } div#details { float: right; } ul { list-style: none; } div#images ul li { float: left; width: /*imgwidth*/; height: /*imgheight*/; } div#details ul li { margin: 0 0 10px 0; } div#details ul li span { display: block; clear: none; width: 80px; } [/code] That should get you started.... Crikey! that chrimbo spirit has really kicked in.
  4. change your variable names! use maybe mode=message&id=xyz then just change your code to recognize the correct part ($_GET['mode'])
  5. You need to do some url rewriting (mod rewrite) in apache. 1st you need to make sure you can - some hosts will not let you. this link will probably the one that will help you most initially. [url=http://www.alistapart.com/articles/succeed/]http://www.alistapart.com/articles/succeed/[/url] This guy has set up his entire site to be run from index.php something I do quite a bit but only recently have I started to use this method for search engine friendly urls - BUT a very good tool if you ask me (makes coding significantly easier too.)
  6. you will always use mysql_connect("localhost", "admin", "1admin") or die(mysql_error()); mysql_select_db("test") or die(mysql_error()); (or similar - pconnect, mysqli etc etc). TEST is the name of the database NOT the table. The localhost, admin and 1admin are your connection details host, username, password - these will more than likely change on a  per site basis. thats it. That makes a connection. After that you will query each table(s) for what ever info you need. [code]<?php $qry = "SELECT * FROM `users` WHERE `password`= '" . sha1($_POST['password'] . "'"; $qry = mysql_query($qry); ... ?> [/code] Hows that?
  7. a connection is a connection - no matter if you are just reading from a table or making changes - you will use the same code to connect. You select a database to work with NOT a table and then simply query the relevant table within teh database.
  8. you coudl always check the size of the dimensions of file the file before displaying - if it is larger than a spcified value then use teh gd functions to create a new smaller image resampled from the orginal.
  9. if you don't have persistent connections then the connections are closed at the end of teh script automatically - but closing them manually is IMO good practice when using multiple connections...
  10. use stripslashes($string) where $string is the info you are outpuuting to the screen.
  11. absolute positioning supoort is not too hot in ie 6 and less. try to avoid it for now. without deeing your page - what it shoudl look like and where it fails - that is all the advice I can give.
  12. all I can say is that IE's support for png files was very porr before 7 came along . try saving those images as gif an see what happens.
  13. in many cases these arrays would be more useful if the keys were switched. I'll use mjdamato's as an example. with this array [code]<?php $users[0]['id'] = 0; $users[0]['name'] = 'John'; $users[0]['email'] = 'john@yahoo.com'; $users[1]['id'] = 1; $users[1]['name'] = 'Mary'; $users[1]['email'] = 'mary@gmail.com'; $users[2]['id'] = 2; $users[2]['name'] = 'Alex'; $users[2]['email'] = 'alex@hotmail.com'; ?>[/code] All you can really do is loop through it. There is no simply way to find anything in there. if the array were like so however... [code]<?php $users['id'][0] = 0; $users['name'][0] = 'John'; $users['email'][0] = 'john@yahoo.com'; $users['id'][1] = 1; $users['name'][1] = 'Mary'; $users['email'][1] = 'mary@gmail.com'; $users['id'][2] = 2; $users['name'][2] = 'Alex'; $users['email'][2] = 'alex@hotmail.com'; ?>[/code] I can now search that array for information based on another piece of info. so say I wanted to print email address of all the people called mary (image a bigger array with more than one mary). I can use [code]<?php $marys = array_keys($users['name'], 'Mary'); foreach($marys as $key => $val) { echo $users['email'][$val]; } keeping string keys as the major key in a 2D array has distinct advantages...[/code]
  14. if you are confident that the contents of your page will fit within a 600px high screen then you could set the height of the html and body to 100% and give the scrolling div a fixed height. Think is using something like FF with a couple of extensions showing as tool bars you are severly restricted in teh actual height of teh viewing area of the site. IMO it is best to avoid going dwon the fixed height route - especially if you don't want to annoy your visitors A LOT.
  15. instead of writing the refresh via meta tags use.. header('Location: ' . $last_url ); You can take teh opportunity to build the $last_url page based on teh info you extract from the data you stored. The header must come before you output any html or whitespace.
  16. A few hosts do not allow mod rewrite on shared hosting servers - They moan about some security but I don't think it's that much of an issue. Some will demand u have a dedicated server but personally I think this is all a bit un justified. They simply need to ensure AllOverride FileInfo is set on your directory in the apache config file which can be done easily and if they use anything like plesk then this can be set as default. Good luck finding a host that will allow you to use this wonderful tool.
  17. Update on this one... Not solved the problem yet but it appears to be when more than one paragraph appears in the text div. Hope that refreshes someones memory
  18. OK how can I solve this. I have a content div which has a left margin of 140px; and a right border of 1px. There is a div to the left containg a div for navigation (sub nav width 140). The navigation list has sub list. If the active section (the item in the list) has no sub-sections (ie. the li element has no child ul or li) then the left border of the content div moves all the way to the left of the page other wise it maintains its margin left setting and the border is in teh correct place. The site is not live yet so I am including a couple of images to show you. Image 1 is when the selected li has no child li's and image 2 is when it does. here is the relevant html for ech case... case 1 (the problem) [code] <div id="wrapper"> <div class="normal" id="accessibilty"> <span>Text Size</span> <a id="accessnormal" href="/about-us/people/directors/mike-douglas/normaltext" title="Normal Text"><span>Normal Text</span></a> <span class="hidden">|</span> <a id="accesslarger" href="/about-us/people/directors/mike-douglas/largertext" title="Larger Text"><span>Larger Text</span></a> <span class="hidden">|</span> <a id="accessbig" href="/about-us/people/directors/mike-douglas/largertext" title="Big text"><span>Big Text</span></a> </div> <div id="leftpanel"> <h1><a class="live" href="/about-us" title="About Us">About Us</a></h1> <div id="subnav"> <ul> <li><a class="live" href="/about-us/people" title="People">People</a> <ul> <li><a class="live" href="/about-us/people/directors" title="Directors">Directors</a> <ul> <li><a class="live" href="/about-us/people/directors/mike-douglas" title="Mike Douglas">Mike Douglas</a> </li> <li><a href="/about-us/people/directors/rob-charlton" title="Rob Charlton">Rob Charlton</a></li> <li><a href="/about-us/people/directors/joe-gellert" title="Joe Gellert">Joe Gellert</a></li> <li><a href="/about-us/people/directors/andy-roberts" title="Andy Roberts">Andy Roberts</a></li> <li><a href="/about-us/people/directors/richard-elphick" title="Richard Elphick">Richard Elphick</a></li> </ul> </li> <li><a href="/about-us/people/employee-spotlight" title="Employee Spotlight">Employee Spotlight</a></li> </ul> </li> <li><a href="/about-us/history" title="History">History</a></li> <li><a href="/about-us/background" title="Background">Background</a></li> <li><a href="/about-us/culture" title="Culture">Culture</a></li> <li><a href="/about-us/approach" title="Approach">Approach</a></li> <li><a href="/about-us/news" title="News">News</a></li> </ul> </div> </div> <div id="content"> <div id="media"> <img src="/global/images/people/directors/rob-charlton.jpg" alt="Rob Charlton - Managing Director" width="380" height="320" longdesc="/longdesc.php/rob_charlton" /> </div> <div id="text"> <h1>Mike Douglas</h1> <h2>Chairman</h2> <p>Mike joined Waring and Netts in 1972 following the completion of his training in America. Mike has been involved in many major schemes over the years including Blyth Community Hospital and Health Centre and more recently the Newcastle Hospitals PFI. Mike became Chairman of the business following incorporation in 2004 and leads the board in its strategic direction.</p><p>A keen sportsman Mike’s interests include Cricket, Rugby and Fishing.</p> <a href="/userfiles/mike-douglas.pdf" title="Mike Douglas">Curriculum Vitae</a> </div> <div class="clear"></div> </div> [/code] case 2 (when the li has li children) [code] <div id="wrapper"> <div class="normal" id="accessibilty"> <span>Text Size</span> <a id="accessnormal" href="/about-us/people/directors/normaltext" title="Normal Text"><span>Normal Text</span></a> <span class="hidden">|</span> <a id="accesslarger" href="/about-us/people/directors/largertext" title="Larger Text"><span>Larger Text</span></a> <span class="hidden">|</span> <a id="accessbig" href="/about-us/people/directors/largertext" title="Big text"><span>Big Text</span></a> </div> <div id="leftpanel"> <h1><a class="live" href="/about-us" title="About Us">About Us</a></h1> <div id="subnav"> <ul> <li><a class="live" href="/about-us/people" title="People">People</a> <ul> <li><a class="live" href="/about-us/people/directors" title="Directors">Directors</a> <ul> <li><a href="/about-us/people/directors/mike-douglas" title="Mike Douglas">Mike Douglas</a></li> <li><a href="/about-us/people/directors/rob-charlton" title="Rob Charlton">Rob Charlton</a></li> <li><a href="/about-us/people/directors/joe-gellert" title="Joe Gellert">Joe Gellert</a></li> <li><a href="/about-us/people/directors/andy-roberts" title="Andy Roberts">Andy Roberts</a></li> <li><a href="/about-us/people/directors/richard-elphick" title="Richard Elphick">Richard Elphick</a></li> </ul> </li> <li><a href="/about-us/people/employee-spotlight" title="Employee Spotlight">Employee Spotlight</a></li> </ul> </li> <li><a href="/about-us/history" title="History">History</a></li> <li><a href="/about-us/background" title="Background">Background</a></li> <li><a href="/about-us/culture" title="Culture">Culture</a></li> <li><a href="/about-us/approach" title="Approach">Approach</a></li> <li><a href="/about-us/news" title="News">News</a></li> </ul> </div> </div> <div id="content"> <div id="media"> <img src="/global/images/people/directors/rob-charlton.jpg" alt="Rob Charlton - Managing Director" width="380" height="320" longdesc="/longdesc.php/rob_charlton" /> </div> <div id="text"> <h1>Directors</h1> <p>A mixed bunch, with spare time interests that range from travelling the world to raising alpacas, what unites the people that make up our Board is their many years’ experience, as well as a passion for exploring new and better ways of doing things.</p> </div> <div class="clear"></div> </div> </div> [/code] and finally the relevant css [code] div#wrapper { position: relative; top: 0; bottom: 0; border-bottom: 1px solid #fff; border-top: 1px solid #fff; margin: 18px 0; } div#wrapper div#leftpanel { float: left; clear: left; z-index: 1; } div#wrapper div#rightpanel { float: right; clear: right; z-index: 1; } div#wrapper div#leftpanel div#subnav , div#wrapper div#rightpanel div#subnav { width: 140px; } /*SUBNAV*/ div#wrapper div#leftpanel div#subnav ul , div#wrapper div#rightpanel div#subnav ul { list-style-type: none; margin: 1em 0; font-size: 0.8em; } div#wrapper div#leftpanel div#subnav li , div#wrapper div#rightpanel div#subnav li { margin: 2px 5px 2px 0; text-indent: -5px; padding-left: 5px; } div#wrapper div#leftpanel div#subnav ul ul , div#wrapper div#rightpanel div#subnav ul ul { margin: 0 0 0 5px; font-size: 1em; } div#wrapper div#leftpanel div#subnav a , div#wrapper div#rightpanel div#subnav a { font-size: 0.9em; font-weight: bold; } a.live { background: transparent; color: #fdad3e; } div#wrapper div#content { padding: 0 0 0 0; margin-left: 140px; border-left: 1px solid gray; padding-left: 10px; } [/code] Any help here would really be appreciated...(and here's me thinking MS were really trying to give better standards support - that is of course I haven't balles it up!) [attachment deleted by admin]
  19. [code] <body> <div id="header">   <a href="/"><span>Your Site Title</span></a> </div> </body> [/code] [code] body { font-family: arial, trebuchet ms, verdana; } #header a { display: block; width: 90px; height: 55px; background: transparent url(img/logo.gif) no-repeat 0 0; } #header a:link , #header a:hover , #header a:active , #header a:visited { background: url(img/logo-over.gif) no-repeat; } #header a span { display: none; } [/code] beauty of that is it shows your site title when css is off. YOU could also speed thinsg up a bit by making ONE image that was 90 px wide and 110px high. The top half of the image being the one you want to show and the bottom half teh one you want on hover, visited etc. Then all you woudl need is... [code] #header a { display: block; width: 90px; height: 55px; background: transparent url(img/logo.gif) no-repeat 0 0; } #header a:link , #header a:hover , #header a:active , #header a:visited { background-position: -55px 0; } #header a span { display: none; } [/code] YOU may have to play with the back gorund position numbers (I can't remeber which way around they shoudl go ;) )
  20. try using % as your font sizes in your css. Or use js to detect window size and switch style sheets accordingly. I personally use just one style sheet with three body selectors of a different class but same id. give them all different font-size attributes in ems or % then switch the class name based on result of screen size check.
  21. you can't. The only alternative is to use js to show a 'title' which would involve you using the mouse over event. Personally I would not bother - more work than its worth.
  22. that is one method. better to use css like so... a img { text-decoration: none; border: none; }
  23. Assigning your data to an array is more useful but what you asked for in teh first post is the old variable variable routine.. [code] <?php $query1 = "SELECT groupName from messageGroups"; $result = mysql_query($query)or die ('Error in query: $query. ' . mysql_error()); $temp = "name$i"; $i = 1; while ($row = mysql_fetch_assoc($result)) { $$temp = $row; $i++; } ?> [/code] then you can traverse these using [code] <?php $i = 1 do { echo $$temp; $i++; } while (isset($$temp)); ?> [/code]
  24. yep $str = " some words and some 8734 0387"; if (preg_match('/[0-9]/', $str)) { echo "its got numbers"; }
×
×
  • 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.