Web Development Questions That Don't Need Their Own Thread v2
3,079 replies, posted
[QUOTE=Kwaq;32352586]i think its just
Options -Indexes
in .htaccess[/QUOTE]That did the trick, cheers.
p.much, i'm having loadsa difficulty making a PHP script that does the following:
i've made a page that accepts input and saves it in a text file, everytime you fill it out, it puts a data entry like the following in a text file on a new line:
Jack,Citizen,1456,Male,Black,63,Mt waverley,no
(name),(surname),(postcode),(gender),(hair),(weight),(suburb),(smoker Y/N)
i'm having trouble, now, making a PHP script that takes input in a field, and searches the text file depending on what field you searched, and displays results.
for example, search the (HAIR) field for 'blonde', and it'll list all entries with 'blonde' in the 'hair' field.
any idea on how to pull this off? if you need to, i can change the way the data is saved, but it must be in plain text.
[QUOTE=Lequinx;32348882]Yes, they did.[/QUOTE]
They're not showing the blogger hosting for $3/month.
[QUOTE=Nerdrage;32353464]p.much, i'm having loadsa difficulty making a PHP script that does the following:
i've made a page that accepts input and saves it in a text file, everytime you fill it out, it puts a data entry like the following in a text file on a new line:
Jack,Citizen,1456,Male,Black,63,Mt waverley,no
(name),(surname),(postcode),(gender),(hair),(weight),(suburb),(smoker Y/N)
i'm having trouble, now, making a PHP script that takes input in a field, and searches the text file depending on what field you searched, and displays results.
for example, search the (HAIR) field for 'blonde', and it'll list all entries with 'blonde' in the 'hair' field.
any idea on how to pull this off? if you need to, i can change the way the data is saved, but it must be in plain text.[/QUOTE]
[url=http://php.net/manual/en/function.explode.php]explode()[/url] at every new line and loop through the array exploding the comma. Then [URL="http://au.php.net/manual/en/function.in-array.php"]in_array()[/URL] to check if it's been input.
In some browsers a big blue box forms around my header, and my menu's width/height isn't displayed correctly even though I have a doctype, would anyone know why this is?
[thumb]http://api.browsershots.org/png/original/bb/bb0c08d330eed6bc30dbc79cf0a5e20f.png[/thumb]
[thumb]http://api.browsershots.org/png/original/31/3147252626e91174284702f9d45be3fc.png[/thumb]
[thumb]http://api.browsershots.org/png/original/08/088454a5168f7500e7a5d12db27a52b6.png[/thumb]
[thumb]http://api.browsershots.org/png/original/f4/f4634bd3c5ed69808e949718df5d58f3.png[/thumb]
[QUOTE=mobrockers2;32354016]In some browsers a big blue box forms around my header, and my menu's width/height isn't displayed correctly even though I have a doctype, would anyone know why this is?
[thumb]http://api.browsershots.org/png/original/bb/bb0c08d330eed6bc30dbc79cf0a5e20f.png[/thumb]
[thumb]http://api.browsershots.org/png/original/31/3147252626e91174284702f9d45be3fc.png[/thumb]
[thumb]http://api.browsershots.org/png/original/08/088454a5168f7500e7a5d12db27a52b6.png[/thumb]
[thumb]http://api.browsershots.org/png/original/f4/f4634bd3c5ed69808e949718df5d58f3.png[/thumb][/QUOTE]
Different browsers have different default stylesheets. You can use a reset stylesheet such as [url=http://developer.yahoo.com/yui/reset/]YUI Reset[/url], which will remove all the default css.
Add this before your stylesheet.
[css]
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.9.0/build/reset/reset-min.css">
[/css]
[QUOTE=Jelly;32354116]Different browsers have different default stylesheets. You can use a reset stylesheet such as [url=http://developer.yahoo.com/yui/reset/]YUI Reset[/url], which will remove all the default css.
Add this before your stylesheet.
[css]
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.9.0/build/reset/reset-min.css">
[/css][/QUOTE]
Thanks it worked!! Can't believe I couldn't find that anywhere.
[editline]18th September 2011[/editline]
Hmm it seems to have had the unfortunate side effect that my h1 etc don't work anymore either o.O
[editline]time[/editline]
Nvm, placed the reset before my stylesheet link per accident.
[QUOTE=mobrockers2;32354243]Thanks it worked!! Can't believe I couldn't find that anywhere.
[editline]18th September 2011[/editline]
Hmm it seems to have had the unfortunate side effect that my h1 etc don't work anymore either o.O
[editline]time[/editline]
Nvm, placed the reset before my stylesheet link per accident.[/QUOTE]
You're supposed to place it before your stylesheet link. You're meant to decide what size you want your h1, h2 etc elements because they're usually different on all browsers as their default stylesheet is different.
[QUOTE=Jelly;32354293]You're supposed to place it before your stylesheet link. You're meant to decide what size you want your h1, h2 etc elements because they're usually different on all browsers as their default stylesheet is different.[/QUOTE]
I already have h1, h2 etc defined, I just put it after my own stylesheet link per accident.
[QUOTE=mobrockers2;32354309]I already have h1, h2 etc defined, I just put it [b]after[/b] my own stylesheet link per accident.[/QUOTE]
[QUOTE=mobrockers2;32354243]Nvm, placed the reset [b]before[/b] my stylesheet link per accident.[/QUOTE]
[QUOTE=Jelly;32354343][/QUOTE]
Oh silly me :v:
javascript:
Using document.body in a window load event returns not only the pages body, but also the body of any iframes; like youtube videos.
How can I only get the pages body?
[IMG]http://puu.sh/5QID[/IMG]
How can I get the background colour of the div to only be grey behind the text instead of the width of the page? is there a simple way using html/css?
[QUOTE=Oppenheimer;32379359][IMG]http://puu.sh/5QID[/IMG]
How can I get the background colour of the div to only be grey behind the text instead of the width of the page? is there a simple way using html/css?[/QUOTE]
#menu {
width: something
}
#menu_color {
width: width of combined text
background: color
}
<div id="menu">
<div id="menu_color">
This should work, though I only started on css like 3 days ago so might not work I dunno??
[QUOTE=Oppenheimer;32379359][IMG]http://puu.sh/5QID[/IMG]
How can I get the background colour of the div to only be grey behind the text instead of the width of the page? is there a simple way using html/css?[/QUOTE]If you use a <span> for the text instead of a <div> it should work how you want it to.
Anyone know any decent APIs for getting stock prices?
Thanks guys, I just used a span, and it worked perfectly!
My solution would work too right? Right? :v:
[QUOTE=mobrockers2;32380375]My solution would work too right? Right? :v:[/QUOTE]
I used your idea to add a separate class for the text, and then used a span and just set the background colour with that, I didn't need to do any width stuff :smile:
[editline]a[/editline]
Does anybody know how I could have a <span> inside a list without it being invalid markup? I can't figure out a way, I tried to change the<ul> to <ul id="navtext">, but it doesn't work.
I never even knew what a span did before now, thanks :v:
[QUOTE=Oppenheimer;32380445]I used your idea to add a separate class for the text, and then used a span and just set the background colour with that, I didn't need to do any width stuff :smile:
[editline]a[/editline]
Does anybody know how I could have a <span> inside a list without it being invalid markup? I can't figure out a way, I tried to change the<ul> to <ul id="navtext">, but it doesn't work.[/QUOTE]
You don't need to use spans at all, just set a background colour for "#menu ul li" or whatever id or class you're using for the menu.
[QUOTE=iamacyborg;32388920]You don't need to use spans at all, just set a background colour for "#menu ul li" or whatever id or class you're using for the menu.[/QUOTE]
Should've thought of that. Yes this is the best way.
what is the actual difference between id and class? are there reasons for using certain ones in certain situations?
[QUOTE=Kwaq;32390775]what is the actual difference between id and class? are there reasons for using certain ones in certain situations?[/QUOTE]
classes can be re-used, id's are a one a page thing. I like using id's when I don't have to re-use it simply because I can't re-use it. Also the blue in notepad++ is a nice color :3:
[QUOTE=mobrockers2;32390794]classes can be re-used, id's are a one a page thing. I like using id's when I don't have to re-use it simply because I can't re-use it. Also the blue in notepad++ is a nice color :3:[/QUOTE]
[url]www.tizag.com/cssT/cssid.php[/url]
There really isnt anything
Its based on how you want to organise it
[QUOTE=zzlawlzz;32390873]What do you mean reused?
I sometimes fill up a website with same id tags hanging
I think its just that id has higher priority than classes?[/QUOTE]
You cannot use the same id tag twice in the same document.
Have you ever validated your documents?
[url]http://dl.dropbox.com/u/5483751/Websites/rouke/idtest.html[/url]
Just made this for you.
And does it validate without errors?
[url]http://validator.w3.org/check?uri=http%3A%2F%2Fdl.dropbox.com%2Fu%2F5483751%2FWebsites%2Frouke%2Fidtest.html&charset=%28detect+automatically%29&doctype=Inline&group=0[/url]
Nope.
[QUOTE=mobrockers2;32390892]You cannot use the same id tag twice in the same document.
Have you ever validated your documents?[/QUOTE]
Nope
I think it's good practice to use classes when re-using and ids when it's unique, even if it isn't exactly required by the specification. Keeps things more organized, and goes through the validation at the same time.
[QUOTE=Dragory;32390994]I think it's good practice to use classes when re-using and ids when it's unique, even if it isn't exactly required by the specification. Keeps things more organized, and goes through the validation at the same time.[/QUOTE]
YaY I'm doing something good.
Is it better to use a .css file and an .html file, or stick your css in style tags within the .html file?
And why?
Sorry, you need to Log In to post a reply to this thread.