• Web Development Questions That Don't Need Their Own Thread v2
    3,079 replies, posted
[QUOTE=Alcapwne;31188663]How can I stop it from creating a new line every time I close a tag? here's my code: [php]<hr><h6>About Me</h6><hr><h6>Rates</h6><hr><h6>Contact</h6><hr>[/php] And it essentially goes <br> after each piece of text, because of the end tag :( But I need to have the end tags where they are. [editline]18th July 2011[/editline] nevermind, solved the problem using different classes for each of the pieces of text, but it would be nice to know the answer for future reference :)[/QUOTE] [css]display: inline-block;[/css] ?
inline-block is simply terrible
I started learning Ruby on Rails. I feel like I have enough experience to make a simple anonymous guest book. Would this be a good place to start?
[QUOTE=toaster468;31197314]I started learning Ruby on Rails. I feel like I have enough experience to make a simple anonymous guest book. Would this be a good place to start?[/QUOTE] That's a pretty simple project. Rails is more designed for doing large applications anyhow. Perhaps you could develop a guestbook SaaS, where people can link to your software from their site similar to how Facebook comments work.
[url]http://www.avidloanstudio.com/boblurie[/url] I'm having some problems with this page in google chrome. The first image shows infront of the dropdown menu, and I can't hover down the menu past where the slides start. Seems to work fine in IE, though.
[QUOTE=SomeFaggot;31210625][url]http://www.avidloanstudio.com/boblurie[/url] I'm having some problems with this page in google chrome. The first image shows infront of the dropdown menu, and I can't hover down the menu past where the slides start. Seems to work fine in IE, though.[/QUOTE] The first image has a z-index of 4, the drop down menu parts have a z-index of 3. Change the z-index of .sub to something higher.
[QUOTE=deadeye5362;31211150]The first image has a z-index of 4, the drop down menu parts have a z-index of 3. Change the z-index of .sub to something higher.[/QUOTE] Fuck, no wonder that z-index stuff I was doing wasn't working. I was working on the wrong style sheet. :downs: Thanks, it works now.
[QUOTE=tagnara;31189321]inline-block is simply terrible[/QUOTE]What should you use instead? Just plain old inline?
[QUOTE=Epic Sandwich;31211880]What should you use instead? Just plain old inline?[/QUOTE] It really depends on what you're trying to achieve.
inline-block can be useful at times, I wouldn't instantly exclude it as a possibility, but there is usually a better way to get it done.
i need 0.50 bucks for webhost damm im broke :s
[QUOTE=tagnara;31203408]That's a pretty simple project. Rails is more designed for doing large applications anyhow. Perhaps you could develop a guestbook SaaS, where people can link to your software from their site similar to how Facebook comments work.[/QUOTE] For simple administrating I have thought of a way of doing it and I am wondering if this would be a possible method. Have a cookie saved to my computer, then check if there is a cookie on my system that equals an administrator cookie then allow them access to delete posts. (sounds messy but I think I can do it)
[QUOTE=toaster468;31216888]For simple administrating I have thought of a way of doing it and I am wondering if this would be a possible method. Have a cookie saved to my computer, then check if there is a cookie on my system that equals an administrator cookie then allow them access to delete posts. (sounds messy but I think I can do it)[/QUOTE] [B]NO[/B]. [B]NO NO NO NO NO.[/B] A cookie is a piece of client-side data. As so, any user with very basic knowledge can go to said cookie, edit it (or create it), and [b]WAM[/b], they have administrator access. [b]NEVER[/b] trust cookie contents. Your website will be [B]HACKED[/B]. You friends will leave you and [B]MOCK YOU[/B]. Your children will grow up to be ugly and [b]UNLOVED[/B]. Your manly-hood will [b]RECEDE[/B] inside your body. You will [b]DIE[/b] from serious [b]DISEASES[/b] and [b]DEATH[/b]. When you're dead and buried, people from all over will flock to your grave, where they will empty their [B]BOWELS[/B], in an eternal ritual punishment for your crimes on this earth. [b]READ:[/b] [url=http://en.wikipedia.org/wiki/HTTP_cookie]HTTP Cookie[/url] - Wikipedia [url=http://www.ietf.org/rfc/rfc2109.txt]RFC 2109 - HTTP State Management Mechanism[/url] - IETF [url=http://curl.haxx.se/rfc/cookie_spec.html]Client-Side State - HTTP Cookies[/url] (Original specification) [b]NO.[/b]
[QUOTE=StinkyJoe;31217024][B]NO[/B]. [B]NO NO NO NO NO.[/B] A cookie is a piece of client-side data. As so, any user with very basic knowledge can go to said cookie, edit it (or create it), and [b]WAM[/b], they have administrator access. [b]NEVER[/b] trust cookie contents. Your website will be [B]HACKED[/B]. Your children will grow up to be ugly and [b]UNLOVED[/B]. You will [b]DIE[/b] from serious [b]DISEASES[/b] and [b]DEATH[/b]. [b]NO.[/b][/QUOTE] yes you will [b]DIE[/b] from [b]DEATH[/b]!
is it possible for php where I do [php]include('page/'.$pagename.'.php');[/php] Then if there is an error from that include then redirect person to 404 Example is [php]$pagename =''; include('page/'.$pagename.'.php');[/php] which turns to page/.php Then it will show some error saying how it cant be found. but instead of that error, the person is redirected to the 404 page.
[QUOTE=zzlawlzz;31217405]is it possible for php where I do [php]include('page/'.$pagename.'.php');[/php] Then if there is an error from that include then redirect person to 404 Example is [php]$pagename =''; include('page/'.$pagename.'.php');[/php] which turns to page/.php Then it will show some error saying how it cant be found. but instead of that error, the person is redirected to the 404 page.[/QUOTE] [php] if(!file_exists($path_to_file)) { ... go to 404 ... } include $path_to_file; [/php] Be very careful about this, or you'll expose yourself to directory traversal attacks. [editline]20th July 2011[/editline] [QUOTE=DontDoShit;31215280]i need 0.50 bucks for webhost damm im broke :s[/QUOTE] If you tell me what you want the webhost for, I might paypal you the 0.50 bucks.
[QUOTE=StinkyJoe;31217024][B]NO[/B]. [B]NO NO NO NO NO.[/B] A cookie is a piece of client-side data. As so, any user with very basic knowledge can go to said cookie, edit it (or create it), and [b]WAM[/b], they have administrator access. [b]NEVER[/b] trust cookie contents. Your website will be [B]HACKED[/B]. You friends will leave you and [B]MOCK YOU[/B]. Your children will grow up to be ugly and [b]UNLOVED[/B]. Your manly-hood will [b]RECEDE[/B] inside your body. You will [b]DIE[/b] from serious [b]DISEASES[/b] and [b]DEATH[/b]. When you're dead and buried, people from all over will flock to your grave, where they will empty their [B]BOWELS[/B], in an eternal ritual punishment for your crimes on this earth. [b]READ:[/b] [url=http://en.wikipedia.org/wiki/HTTP_cookie]HTTP Cookie[/url] - Wikipedia [url=http://www.ietf.org/rfc/rfc2109.txt]RFC 2109 - HTTP State Management Mechanism[/url] - IETF [url=http://curl.haxx.se/rfc/cookie_spec.html]Client-Side State - HTTP Cookies[/url] (Original specification) [b]NO.[/b][/QUOTE] Would a password system be better? I could generate some insanely long cryptic password? Or saving my home IP and checking if they are the same as the one in the database?
[QUOTE=toaster468;31217535]Would a password system be better? I could generate some insanely long cryptic password? Or saving my home IP and checking if they are the same as the one in the database?[/QUOTE] Assuming you have a user system in place, or plans to do so, simply add an 'is administrator' boolean property. Otherwise a simple hard-coded login system should do the trick, using a session stored on the server, as opposed to a state cookie.
[QUOTE=toaster468;31216888]For simple administrating I have thought of a way of doing it and I am wondering if this would be a possible method. Have a cookie saved to my computer, then check if there is a cookie on my system that equals an administrator cookie then allow them access to delete posts. (sounds messy but I think I can do it)[/QUOTE] use a session instead
[QUOTE=StinkyJoe;31217466][php] if(!file_exists($path_to_file)) { ... go to 404 ... } include $path_to_file; [/php] Be very careful about this, or you'll expose yourself to directory traversal attacks. [editline]20th July 2011[/editline] If you tell me what you want the webhost for, I might paypal you the 0.50 bucks.[/QUOTE] oh.. uhm ok thanks... I guess i wont be using it.
[url]http://www.facepunch.com/threads/1092866-Web-Development-Questions-That-Don-t-Need-Their-Own-Thread-v2?p=30621854&viewfull=1#post30621854[/url]
[QUOTE=StinkyJoe;31217572]Assuming you have a user system in place, or plans to do so, simply add an 'is administrator' boolean property. Otherwise a simple hard-coded login system should do the trick, using a session stored on the server, as opposed to a state cookie.[/QUOTE] [QUOTE=Ac!dL3ak;31217765]use a session instead[/QUOTE] -ninja'd-
[url]http://www.php.net/manual/en/book.session.php[/url]
[QUOTE=toaster468;31217925]What do you guys mean by session? I am new to this stuff.[/QUOTE] [QUOTE=Ac!dL3ak;31217782][url]http://www.facepunch.com/threads/1092866-Web-Development-Questions-That-Don-t-Need-Their-Own-Thread-v2?p=30621854&viewfull=1#post30621854[/url][/QUOTE]
[QUOTE=toaster468;31217925]-ninja'd-[/QUOTE] I would recommend using hard coded login system with session :v:
I might temporarily give up on the administration system. I am not that good yet, if I really need to delete something ill just go to the actual database and delete it manually. [editline]19th July 2011[/editline] Wow wtf facepunch reply system
How would I go about searching for certain words such as "apple" or "pear" in a text field / text area using PHP?
[QUOTE=twenty;31224159]How would I go about searching for certain words such as "apple" or "pear" in a text field / text area using PHP?[/QUOTE] That's pretty vague do you want to determine whether the certain word is within a string, do you want to highlight said word, etc?
[QUOTE=Jelly;31224411]That's pretty vague do you want to determine whether the certain word is within a string, do you want to highlight said word, etc?[/QUOTE] Well, I was thinking of putting a list of words in an array and checking the field against it. I'm trying to make a quiz type "game" and I cannot think of how I would check if the user has the word that is inside the array, entered into the text area.
[QUOTE=twenty;31224601]Well, I was thinking of putting a list of words in an array and checking the field against it. I'm trying to make a quiz type "game" and I cannot think of how I would check if the user has the word that is inside the array, entered into the text area.[/QUOTE] [php] if(in_array($answer, $answers)) [/php]
Sorry, you need to Log In to post a reply to this thread.