• Web Dev Questions That Don't Need Their Own Thread v4
    5,001 replies, posted
Array: Apple => 1 Orange =>2 Form: Input name = fruit type = text: Submit How do I make it so that the form sends a GET request of 2 if someone writes in and sends "orange" I don't want the get request to have the word orange in it.
[QUOTE=01271;42095531]Array: Apple => 1 Orange =>2 Form: Input name = fruit type = text: Submit How do I make it so that the form sends a GET request of 2 if someone writes in and sends "orange" I don't want the get request to have the word orange in it.[/QUOTE] [del]I suppose the procedure is the same in every/most languages In PHP it looks like this[/del] nope I need sleep
[QUOTE=Epiclulz762;42093226]I have had issues bridging my Apache server to my SMTP server. Replacing my sendmail service with Postfix I can forward mail through Gmail, Office365 and other accounts. Do know I use CentOS and not Ubuntu but I too had issues. It took me a while to figure a solution out and once I did I recorded each command I used. I can post my process step by step if you want me to.[/QUOTE] I tried postfix like a week ago but it was a bear to configure. I guess I have no other chance.
[QUOTE=gokiyono;42095727]I suppose the procedure is the same in every/most languages In PHP it looks like this [PHP] $fruitVar = $_GET['fruitType']; // Together with some filters $fruitVar = strtolower($fruitVar); // Make all the letters lover-case (so it shouldn't matter weather or not they want to abuse the shift key) $fruitVar = ucwords($fruitVar); // Make the first letter (in each word) upper case because your variable is so. (Not really needed, but that is how you wrote your variable) $array = array('Apple'=>1,'Orange'=>2); foreach($array as $key => $value){ if($key == $fruitVar){ $result = $value; } } echo $result; [/PHP][/QUOTE] Noo no no [php] <?php $fruitMap = array( "apple" => 1, "orange" => 2 ); if(!empty($_GET["fruitType"]) && isset($fruitMap[$_GET["fruitType"]])) { $fruitName = $fruitMap[$_GET["fruitType"]]; } else { // fruitType not set, or unknown fruit type } [/php]
[QUOTE=StinkyJoe;42096251]Noo no no [php] <?php $fruitMap = array( "apple" => 1, "orange" => 2 ); if(!empty($_GET["fruitType"]) && isset($fruitMap[$_GET["fruitType"]])) { $fruitName = $fruitMap[$_GET["fruitType"]]; } else { // fruitType not set, or unknown fruit type } [/php][/QUOTE] Wow I feel stupid right now I actually feel kinda ashamed for forgetting that it is that simple
[QUOTE=nehkz;42091196]Does anyone know of hosting providers that accept bitcoin?[/QUOTE] There's a few that accept it but the most well known is [url=https://www.namecheap.com/support/payment-options/bitcoin.aspx]namecheap[/url]
Whats wrong with text in chrome? [IMG]http://i.cubeupload.com/gb8mDi.png[/IMG] The M appears 'broken' in rendering in chrome whereas in firefox its working as intended? (chromes the top one in pic). Is it fixable? cause a website I'm making looks fine as a whole in both browers just firefox looks best.
[QUOTE=asantos3;42096385]There's a few that accept it but the most well known is [url=https://www.namecheap.com/support/payment-options/bitcoin.aspx]namecheap[/url][/QUOTE] I knew about namecheap, they're my domain provider. Do you know of any VPS only hosts that accept it?
[QUOTE=thejjokerr;42097089]Does anyone here use Notepad++ to code ruby on rails? If so, does anyone have a working syntax highlighting plugin for Ruby On Rails?[/QUOTE] Ruby on Rails is a framework for the Ruby language...pretty sure N++ comes with Ruby syntax highlighting built-in.
[QUOTE=xianlee;42096668]Whats wrong with text in chrome? [IMG]http://i.cubeupload.com/gb8mDi.png[/IMG] The M appears 'broken' in rendering in chrome whereas in firefox its working as intended? (chromes the top one in pic). Is it fixable? cause a website I'm making looks fine as a whole in both browers just firefox looks best.[/QUOTE] Chrome on Windows has had bad custom font rendering since forever. Still waiting for them to fix it.
[QUOTE=Vietnow;42097349]Chrome on Windows has had bad custom font rendering since forever. Still waiting for them to fix it.[/QUOTE] Ah thought so, did see a thread about it when searching google but didn't know it was still the case, changed the font to another and it seems to be a lot less noticeable now
[QUOTE=nehkz;42091196]Does anyone know of hosting providers that accept bitcoin?[/QUOTE] I've been using the 1GB VPS unit from Microtronix Hosting for BitBin and it has been working really nicely. Their units also look pretty cheap compared to other hosting providers. [url]http://microthosting.com/[/url] or [url]http://clients.microtronix-tech.com/aff.php?aff=009[/url] if you feel like using my affiliate link. :v:
Im thinking of getting one of these [url]http://lowendbox.com/blog/weloveservers-19year-1gb-openvz-in-buffalo-dallas-la-kent-uk-and-orlando/[/url] , probably the $20 one, just to have my personal site and to have a build machine with some extra stuff Just wanted to check if anyone has any bad experience with them at all?
Anyone ever use [url=http://www.opentip.org/index.html]opentip[/url] ? Is it possible to make a style that gets a div's class and uses the class for the colour of its border? [img]https://dl.dropboxusercontent.com/u/18642216/opentip.png[/img] I am interested in making this style of tip with a border that changes colour to the background-color of the element it's hovering over. So hovering over a blue background object, the border would be blue. Hovering over an orange object, border orange. etc. I have few enough colours that I could make individual styles for each colour. Or how do I style them in general, I'm sure as hell not putting tags all over my page to customize them 1 by 1.
-fixed it-
I just restarted php-fpm and my php scripts no longer work. I tried a <?php echo "hi."; ?> script and it worked but the rest of my site does not. What could be the cause? phpinfo(); makes the page break completely and be completely blank, ignoring the "hi". GAAH, online tutorials have compounded the error, now they're all 404 pages.
- snip -
I don't even have php logs anymore. I think it's time to uninstall php and nginx and just do a blank slate again. Every page that exists shows "No input file specified." while index.php is a 404 page. [editline]8th September 2013[/editline] what the fuck is this. Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 14 bytes)
If you're using nginx to proxy the requests, make sure your rules are set up properly.
oh my god it took so much time and effort but ultimately I fixed it all. I am never using a google tutorial again.
I remember seeing in the WAYWO or maybe this thread someone was working on a [b]beautiful[/b] error handler theme for some language? I believe it showed a very verbose error message and a stack trace. I was wondering what would be the most elegant solution for error messages? I'm specifically looking for one for php (My job revolves mostly around php, I'd love to use this on our sites), and possibly ruby. If anyone has any ideas what would work best for either of these, please let me know.
Sounds like you're describing [url=https://github.com/charliesome/better_errors]better_errors[/url] by swift and shift, for Ruby at least. I hate PHP as as such don't know if anything like better_errors exists for it.
I think that's one that I was thinking of. Thank you very much. If anyone had an idea of what a php-type version of this may be. Or maybe I can try to implement a php one using this design (with permission of course).
[QUOTE=TehWhale;42128304]I think that's one that I was thinking of. Thank you very much. If anyone had an idea of what a php-type version of this may be. Or maybe I can try to implement a php one using this design (with permission of course).[/QUOTE] [url]https://github.com/filp/whoops[/url]
[QUOTE=RusselG;42129311][url]https://github.com/filp/whoops[/url][/QUOTE] Too bad the author is an asshole.
[QUOTE=StinkyJoe;42129896]Too bad the author is an asshole.[/QUOTE] But if it works, that shouldn't really be a problem.
Can you launch a steam game to join a server through your internet browser? If so, how do I do it?
[QUOTE=xianlee;42129969]Can you launch a steam game to join your server through your internet browser? If so, how do I do it?[/QUOTE] steam://connect/IP
[QUOTE=gokiyono;42129922]But if it works, that shouldn't really be a problem.[/QUOTE] We're talking grade-A, big-league-level asshole here, though.
[QUOTE=StinkyJoe;42130027]We're talking grade-A, big-league-level asshole here, though.[/QUOTE] As long as the thing he made works, I wouldn't care how he is.
Sorry, you need to Log In to post a reply to this thread.