• Web Dev Questions That Don't Need Their Own Thread v4
    5,001 replies, posted
Alright, I'll use INI.
How would I make a simple search box that searches a text file on my website? I'm trying to make a search where people put in their steamid and get a "accepted" or "denied" message based upon whether or not their ID has been accepted. For example, I put in a steam ID, and click search. Then, below the search box (or on another page, I don't care) the program returns a simple "yes" or "no" answer. This should be done through a text file.
[QUOTE=Samg381;47023989]How would I make a simple search box that searches a text file on my website? I'm trying to make a search where people put in their steamid and get a "accepted" or "denied" message based upon whether or not their ID has been accepted. For example, I put in a steam ID, and click search. Then, below the search box (or on another page, I don't care) the program returns a simple "yes" or "no" answer. This should be done through a text file.[/QUOTE] Do a Javascript AJAX call to load the text file from the server. Look into jQuery if you're uncertain how to do it with Angular or vanilla JS.
Is it possible in html or php to display media no matter what type it is? Basically, I have a often changing file that has no extension, it could be either a JPG, GIF, WEBM or MP4.
[QUOTE=diwako;47026067]Is it possible in html or php to display media no matter what type it is? Basically, I have a often changing file that has no extension, it could be either a JPG, GIF, WEBM or MP4.[/QUOTE] What exactly do you mean, it doesn't have an extension but you want to give it one? Or do you mean that the file extension changes on the media? In that case, store the entire filename including the extension somewhere, then echo it out. Normally I would have a table containing this information. For example a [B]posts[/B] table of a blog and that has a [B]post_image[/B] that would be a string of the filename. Then I would have PHP look for that file somewhere, and then echo the filename out with the path using simple string concatenation. [code] $path = '/your/path/here/'; $filename = $dataFromDatabase->post_image; // facepunch.png echo $path . $filename; // '/your/path/here/facepunch.png' [/code] If that makes any sense, it should however be a lot more flexible than this. [editline]28th January 2015[/editline] Have a look at [URL="http://php.net/manual/en/reserved.variables.files.php"]$_FILES[/URL] if this is what you're looking for.
[QUOTE=diwako;47026067]Is it possible in html or php to display media no matter what type it is? Basically, I have a often changing file that has no extension, it could be either a JPG, GIF, WEBM or MP4.[/QUOTE] Use [url]http://php.net/manual/en/ref.fileinfo.php[/url] to get the file type and then set a header() matching the content type.
Thank you. What Cyberuben posted is probably the thing I am looking for. I am basically trying to make a function that decides to either use img, video, etc tags, with this it should be pretty easy.
-- SNIP -- Resolved
How reliable of a host is A Small Orange? I'm just looking to host a personal portfolio site. Nothing major. And the $35/year plan sounds really appealing since I don't need much space or multiple domains.
[QUOTE=Meller Yeller;47034931]How reliable of a host is A Small Orange? I'm just looking to host a personal portfolio site. Nothing major. And the $35/year plan sounds really appealing since I don't need much space or multiple domains.[/QUOTE] If you're fine with a static site, generated with Jekyll if you wish, you can go with [url=https://pages.github.com/]GitHub Pages[/url], which is free and allows custom domain names.
Is t barticularly bad practice to include a js file within the body? I ask because I like to split up my view into multiple files so 1 for the base scaffolding of a html page, one for the navigation bar, one for the content... and have each of their dependencies contained in that one file but if one of these depends on js I either need to put the js in there with some script tags or include a js file, and out of the two options I like the second as it keeps the html and js separated
no it's actually recommended to put it at the bottom just above </body>. if you put it in the header without async or defer it will block until the file is fetched and executed
Hey guys. What kind of programm would I use to make small seldom changes to a website? It's fpr our students council and it gets updated maybe 10 to 12 times a year. The current one is in HTML but I don't have the time to get back into scripting the whole thing each time so I'd love to have a solution where I can "click together(pics and text)" the whole thing, basically "What you See Is What You Get" would be best. Any Programms for that?
[QUOTE=Killuah;47039240]Hey guys. What kind of programm would I use to make small seldom changes to a website? It's fpr our students council and it gets updated maybe 10 to 12 times a year. The current one is in HTML but I don't have the time to get back into scripting the whole thing each time so I'd love to have a solution where I can "click together(pics and text)" the whole thing, basically "What you See Is What You Get" would be best. Any Programms for that?[/QUOTE] Is [URL="https://wordpress.org/"]Wordpress[/URL] (a CMS) the kind of thing you're looking for? Or maybe something like [URL="http://macaw.co/"]Macaw[/URL], [URL="https://webflow.com/"]Webflow[/URL] or [URL="http://www.google.com/webdesigner/"]Google Web Designer[/URL]? (Like Photoshop, but for making Websites)
I already have a preexisting small website that I have to work with since it needs to be compliant to university hosting standards. One of these will probably work. Thank you very much!
I am studying computer science, and want to make a portfolio of stuff I make. Which CMS would you recommend?
Howcome some registrars are charging upwards of £60 for .io domains, yet some others have them for £25±? What registrar would you guys recommend? Is namecheap any good? My usual one is fasthost but they only offer a very small amount of domains
[QUOTE=Richy19;47043225]Howcome some registrars are charging upwards of £60 for .io domains, yet some others have them for £25±? What registrar would you guys recommend? Is namecheap any good? My usual one is fasthost but they only offer a very small amount of domains[/QUOTE] Namecheap is the absolute best
Has anyone ever transfered a domain to namecheap? Is it worht doing so? I think I have paid for my domain at fasthost for the next 3 years?
Hopefully somebody can help me with this, should be really easy. I am trying to make it so that when a certain link is clicked, a new page opens in another tab and some information is opened in a box on the original page. What I currently have is the link itself and "iframe=blank" to open in a new page. No need to write me any code, just help me with what kind of tags/tools I should use. [IMG]http://i76.photobucket.com/albums/j21/DrVincentWolf/Show_zps5acoyq8w.jpg[/IMG]
[QUOTE=Richy19;47047663]Has anyone ever transfered a domain to namecheap? Is it worht doing so? I think I have paid for my domain at fasthost for the next 3 years?[/QUOTE] Namecheap is great. I think they give you like a year of free whoisguard if you transfer a domain to them. And I love em.
[QUOTE=DrVincentWolf;47048332]Hopefully somebody can help me with this, should be really easy. I am trying to make it so that when a certain link is clicked, a new page opens in another tab and some information is opened in a box on the original page. What I currently have is the link itself and "iframe=blank" to open in a new page. No need to write me any code, just help me with what kind of tags/tools I should use. [IMG]http://i76.photobucket.com/albums/j21/DrVincentWolf/Show_zps5acoyq8w.jpg[/IMG][/QUOTE] window.open() ? and then display the information
Server configurations? Debian Wheezy Memcache MongoDB Varnish Cache NginX
[QUOTE=Neophyte;47055851]Server configurations? Debian Wheezy Memcache MongoDB Varnish Cache NginX[/QUOTE] I'm not sure if Memcache was a typo or you're actually using the PHP memcache library or if you actually meant Memcache[B]d[/B] - if you're using Memcached I'd personally use [URL="http://redis.io/"]Redis[/URL] over it, especially for Node applications (if I recall correctly you primarily develop in Node) since it offers more features and beats Memcached in terms of performance. As for MongoDB it's generally really fast performance-wise, but it can be drastically improved by using the [URL="http://www.tokutek.com/tokumx-for-mongodb/"]TokuMX[/URL] fork of MongoDB, which essentially is the fastest document-driven database out there. Although this nullifies the amazing mongoose package completely, so you'd have to query it manually.
[QUOTE=siraggi;47040672]I am studying computer science, and want to make a portfolio of stuff I make. Which CMS would you recommend?[/QUOTE] WordPress. You can make anything with it
[QUOTE=Svenskunganka;47056260]I'm not sure if Memcache was a typo or you're actually using the PHP memcache library or if you actually meant Memcache[B]d[/B] - if you're using Memcached I'd personally use [URL="http://redis.io/"]Redis[/URL] over it, especially for Node applications (if I recall correctly you primarily develop in Node) since it offers more features and beats Memcached in terms of performance. As for MongoDB it's generally really fast performance-wise, but it can be drastically improved by using the [URL="http://www.tokutek.com/tokumx-for-mongodb/"]TokuMX[/URL] fork of MongoDB, which essentially is the fastest document-driven database out there. Although this nullifies the amazing mongoose package completely, so you'd have to query it manually.[/QUOTE] Memcached* I'll have a look into Redis, I've heard of it. I'll also have a look at TokuMx also, thanks for the suggestions mate.
[QUOTE=mikkeljuhl;47059986]WordPress. You can make anything with it[/QUOTE] If you use Wordpress you should really make your own theme, I'm not a huge fan of Wordpress anymore personally. I used to like it but it felt like a big pile of things I didn't need.
[url]http://roots.io/[/url] for bootstrap framework on wordpress.
Can anyone recommend some cheap hosting, preferably UK based ? I need at least 20GB of disk space (more if possible), unlimited bandwidth, PHP and MySQL.
[QUOTE=Chryseus;47061913]Can anyone recommend some cheap hosting, preferably UK based ? I need at least 20GB of disk space (more if possible), unlimited bandwidth, PHP and MySQL.[/QUOTE] Any reason for the unlimited bandwidth? How much do you normally use? You're better off buying a VPS over shared website hosting nowadays. It's both cheaper and brings more performance. With what you're trying to do the #1 package [URL="https://hosthatch.com/openvz-ssd-vps"]here[/URL] will probably give you all the resources you need. It's $8 quarterly (~$2.6 / month) and gives you 30GB SSD space under RAID10. I noticed you wanted UK-based - unfortunately they don't have any servers in that area, but they do have in Dronten, Netherlands which is just off-shore for you. Otherwise Stockholm, Sweden is also not too far and pings really nice.
Sorry, you need to Log In to post a reply to this thread.