Web Dev Questions That Don't Need Their Own Thread v4
5,001 replies, posted
[QUOTE=Coment;44926358]Textboxes' text is defined as their value. Therefore, to do what you want, you just need to add the atribute value with the text you want.
[URL="http://jsfiddle.net/mbD3v/"]<input type="textbox" value="I am text." />[/URL][/QUOTE]
There's no such thing as type = "textbox", if you don't define a type or define an unknown type it defaults to "text", so for single-line textboxes you can just do <input>
[QUOTE=Coment;44926358]Textboxes' text is defined as their value. Therefore, to do what you want, you just need to add the atribute value with the text you want.
[URL="http://jsfiddle.net/mbD3v/"]<input type="textbox" value="I am text." />[/URL][/QUOTE]
[code]
<textarea>I am text.</textarea>
[/code]
[editline]27th May 2014[/editline]
Oh, wait, we're talking about textboxes.
[code]
<input type='text' value='I am text.'>
[/code]
[QUOTE=supersnail11;44926566][code]
<textarea>I am text.</textarea>
[/code]
[editline]27th May 2014[/editline]
Oh, wait, we're talking about textboxes.
[code]
<input type='text' value='I am text.'>
[/code][/QUOTE]
You can do type='text' if you want to make it clear that it's purely text or for specific styling, but
[code]<input value='I am text.'>[/code]
is perfectly valid too
did I just mix input type text, checkbox and textarea together
oh god.
If I were to look at creating a forum, what would be the best programming language to do it with and why? I've seen PHP which is often looked at as lame, and I've also seen server-side Javascript which is often praised.
I like PHP, I think it's mostly a matter of preference though, there's also a lot of forum solutions online that give you a lot of customization so you don't have to build your own
[QUOTE=wauterboi;44929534]If I were to look at creating a forum, what would be the best programming language to do it with and why? I've seen PHP which is often looked at as lame, and I've also seen server-side Javascript which is often praised.[/QUOTE]
It all depends on what language you prefer. From my perspective, Ruby (on Rails) would be the most optimal language for a forum software, even though I'm a PHP guy. Would be easiest to make with Ruby aswell.
You could always use [URL="https://github.com/discourse/discourse"]Discourse[/URL].
Hey guys. Currently for my website [url]www.unfgaming.net[/url] when I want to post news, I have to edit the site itself and write a post in HTML.
I've heard of "post authing" where you auth into the site and can post stuff to the site and it keeps the post styling for each post so it doesn't ruin the site style.
I've tried searching for something like this but I can't find anything. Anyone know what I'm talking about?
Sounds like you want a WYSIWYG text box editor and some basic PHP for the authentication.
Fuck this, fuck this, FUCK THIS.
Maintaining a self-made uploader is a bitch. move_uploaded_file fails when it likes, other mkdir changes permissions of folders even though I don't want it to...
Any preferred PHP (or any other language that makes sense, at this point I don't even care) script for handling file uploads in a safe way (max size of files X, files must be Y extension, they get moved to Z folder, etc.)?
[QUOTE=Coment;44931412]Fuck this, fuck this, FUCK THIS.
Maintaining a self-made uploader is a bitch. move_uploaded_file fails when it likes, other mkdir changes permissions of folders even though I don't want it to...
Any preferred PHP (or any other language that makes sense, at this point I don't even care) script for handling file uploads in a safe way (max size of files X, files must be Y extension, they get moved to Z folder, etc.)?[/QUOTE]
If you haven't, I suggest taking a look at [url=http://www.php.net/manual/en/features.file-upload.common-pitfalls.php]this guide[/url].
tale a look at this: [url]http://www.verot.net/php_class_upload.htm[/url]
it supports pretty much everything related to image upload
[QUOTE=Rayjingstorm;44931547]If you haven't, I suggest taking a look at [url=http://www.php.net/manual/en/features.file-upload.common-pitfalls.php]this guide[/url].[/QUOTE]
I checked each of them the moment I set up the current VPS. I love customizing things.
[QUOTE=Lizart;44932909]tale a look at this: [URL]http://www.verot.net/php_class_upload.htm[/URL]
it supports pretty much everything related to image upload[/QUOTE]
Heh, I had that tab already opened 8 tabs ago :v:
Yeah, definitely going to try that one. At the very least, it will make my current script shorter. At best, it fixes bugs.
[QUOTE=Banana Lord.;44930781]Sounds like you want a WYSIWYG text box editor and some basic PHP for the authentication.[/QUOTE]
Any pre-setup package versions of this? I'm basically looking for something similar to the teamfortress.com site where I can auth posts to the site and it auto-adds Older/Newer buttons
[QUOTE=UserNotFound;44934434]Any pre-setup package versions of this? I'm basically looking for something similar to the teamfortress.com site where I can auth posts to the site and it auto-adds Older/Newer buttons[/QUOTE]
Like a blog?
[QUOTE=UserNotFound;44934434]Any pre-setup package versions of this? I'm basically looking for something similar to the teamfortress.com site where I can auth posts to the site and it auto-adds Older/Newer buttons[/QUOTE]
Just use wordpress.
[QUOTE=supersnail11;44934566]Like a blog?[/QUOTE]
Kinda, but I'd rather not use something like Tumblr because it's external. I'm basically looking for something I can pop onto my dedicated box, customize it and bam I'm done.
Is wordpress similar to what I am looking for?
Sounds like it
[QUOTE=UserNotFound;44934921]Kinda, but I'd rather not use something like Tumblr because it's external. I'm basically looking for something I can pop onto my dedicated box, customize it and bam I'm done.
Is wordpress similar to what I am looking for?[/QUOTE]
Blog doesn't mean Tumblr. There are literally hundreds of packages that do exactly what you need that came before Tumblr.
[QUOTE=UserNotFound;44934921]Kinda, but I'd rather not use something like Tumblr because it's external. I'm basically looking for something I can pop onto my dedicated box, customize it and bam I'm done.
Is wordpress similar to what I am looking for?[/QUOTE]
I like Textpattern and I use it for everything including non-blogs:
[url]http://wauterboi.com[/url]
[url]http://www.dotbsp.com[/url]
[url]http://textpattern.com[/url]
Ooh, I see an error with my mobile style. Gotta fix that.
Well thank you all for the advice, I shall check out Wordpress and Textpattern and see which of the two I like.
If you're looking to dig into Wordpress, you should have a little bit of PHP knowledge under your belt. With Textpattern, however, things work a lot differently, and I find it to be pleasant.
Everything's broken up into sections which refer to either the same pages or different pages if necessary. Pages can sport their own HTML. Textpattern comes with it's own special "HTML" tags that allow you to reuse bits of HTML or expand upon the pre-existing forms that comes with TXP, including commenting. It also comes with tags that add conditions to HTML, such as <txp:if_section>.
On wauterboi.com, this is the "HTML" code for the front page:
[code]<html lang="en">
<head>
<txp:output_form form="head" />
</head>
<body>
<div class="navigation">
<txp:output_form form="navi" />
</div>
<div class="content">
<txp:if_section name="music">
<div class="discography"><txp:article form="discs" /></div>
<txp:else />
<txp:article limit="1" form="default" />
</txp:if_section>
<txp:output_form form="footer" />
</div>
<div class="sidebar">
<h2>New Tracks</h2>
<txp:article_custom limit="3" form="tracks" section="music"/>
</div>
</body>
</html>[/code]
An example of a TXP form would be my navigation form:
[code]<div class="navigation">
<h1><a href="/">wauterboi.</a></h1>
<p class="navlinks"><a href="/">home.</a> <a href="/about">about.</a> <a href="/music">music.</a></p>
<p class="extlinks"><a href="http://www.facebook.com/wauterboi"><img src="/images/icons/facebook.png"></a><a href="http://www.twitter.com/wauterboi"><img src="/images/icons/twitter.png"></a><a href="http://www.soundcloud.com/wauterboi"><img src="/images/icons/soundcloud.png"></a><a href="http://www.youtube.com/waut3rofficial"><img src="/images/icons/youtube.png"></a></p>
</div>[/code]
It appears on all pages of the website, and if I need to add a link I just modify that bit.
I'm not really sure if there's any other CMS' that do the job because I've never really felt the need to look elsewhere.
By the way, I probably do really weird stuff with my HTML and CSS because I've pretty much self-taught myself everything I know and haven't really had the need to consult with others, so apologies if some of the ways I tackle web des is weird.
[QUOTE=wauterboi;44939090]By the way, I probably do really weird stuff with my HTML and CSS because I've pretty much self-taught myself everything I know and haven't really had the need to consult with others, so apologies if some of the ways I tackle web des is weird.[/QUOTE]
I ran the wauterboi website through validation, only weird things seem to be no html5 doctype, images should have alt attributes, and in your css you have a "vertical-align: center", center is not a value of vertical align, I think you wanted "middle"
SNIP
So I'm trying to set a loading screen that changes depending on the map the server is currently on, pulling the image from a folder with images named relative to the map names. Any pointers please, I'm pretty stumped.
[QUOTE=Deamie;44950122]SNIP
So I'm trying to set a loading screen that changes depending on the map the server is currently on, pulling the image from a folder with images named relative to the map names. Any pointers please, I'm pretty stumped.[/QUOTE]
When you set up the sv_loadingscreen you can provide map details | look at docs [URL]http://wiki.garrysmod.com/page/Loading_URL[/URL]
That way you could say [code]$map = $_GET['mapname'];[/code]
Then you would associate your mapname with a image like
[code]<img src="images/maps/<?= $map ?>.png" alt="" />[/code]
This is just a lazy example though.
Don't forget to escape the GET parameter with htmlspecialchars():
[code]
$map = htmlspecialchars($_GET['mapname']);
[/code]
[QUOTE=Alternative Account;44960262]Don't forget to escape the GET parameter with htmlspecialchars():
[code]
$map = htmlspecialchars($_GET['mapname']);
[/code][/QUOTE]
I've found it easier to remember to escape input by always using [url=http://php.net/manual/en/function.filter-input.php]filter_input()[/url] for input (GET, POST, cookies, etc.); I only wish that the $filter parameter wasn't optional, because it is useful to be forced to consider how the input needs to be escaped/validated.
[QUOTE=djjkxbox360;44939132]I ran the wauterboi website through validation, only weird things seem to be no html5 doctype, images should have alt attributes, and in your css you have a "vertical-align: center", center is not a value of vertical align, I think you wanted "middle"[/QUOTE]
Thanks for the info! Also, I never add doctypes because I've never really understood what they were for and everything seems to run fine without it. It's one of the things I've never, ever paid attention to and forgot about. I'll be breaking the habit with the new site I'm working on.
[QUOTE=wauterboi;44966276]Thanks for the info! Also, I never add doctypes because I've never really understood what they were for and everything seems to run fine without it. It's one of the things I've never, ever paid attention to and forgot about. I'll be breaking the habit with the new site I'm working on.[/QUOTE]
It tells the browser what version of HTML you're using, I think it's mainly so browsers can be compatible with old sites that use an old doctype. I'm guessing if you don't provide one it tries to assume what version you're using, it's just best to have the doctype to avoid any problems
Can anyone recommend a good FTP program? I currently use FileZilla but I want one that auto uploads on file save and is free.
I also use Sublime Text 2, so if anyone knows any working FTP addons then that would be awesome too, thanks! :smile:
Sorry, you need to Log In to post a reply to this thread.