Web Dev Questions That Don't Need Their Own Thread v4
5,001 replies, posted
[B]Simple question[/B]
Is there a way to auto detect with of a element, for instance if I got a paragraph typed out and it's 300px width wide and I wan't to catch it in a box, I really hate to do math or guess my way to the width.
Isn't there a way for it to automatically make it as small as it can be (if that makes sense).
There probably is, but I must have forgotten it. :suicide:
[QUOTE=Moofy;42532520]Simple question
Is there a way to auto detect width of a element, for instance if I got a paragraph typed out and it's 300px width wide and I wan't to catch it in a box, I really hate to do math or guess my way to the width.
Isn't there a way for it to automatically make it as small as it can be (if that makes sense).
There probably is, but I must have forgotten it.[/QUOTE]
You know, you can learn a lot from [URL="http://www.google.com"]Google[/URL].
This can be done with the jQuery property [B].width()[/B]. Check the jQuery documentation here: [url]http://api.jquery.com/width/[/url]
[QUOTE=TrinityX;42532763]You know, you can learn a lot from [URL="http://www.google.com"]Google[/URL].[/QUOTE]
Alright without being a rude guy here.. Yes I can learn from Google, but I didn't know exactly what to search for so I came here to questions that don't deserve their own thread. And I ask a question.. That doesn't deserve it's own thread? So it's a bit flippant to link me to Google like I haven't tried already.
[editline]15th October 2013[/editline]
But thank you anyways.
[editline]15th October 2013[/editline]
Also I was just wondering if it was possible without jQuery at the same time.
[QUOTE=andersonmat;42530183]What's the best non-shitty ecommerce software? I feel like most solutions are shit.[/QUOTE]
Give spree a look if you're comfortable with Ruby/Rails.
[QUOTE=KmartSqrl;42532832]Give spree a look if you're comfortable with Ruby/Rails.[/QUOTE]
Interesting. I'll check it out!
I'm [B]very[/B] new to web development but I've been looking into it more and more because of my job which mainly involves me taking care of our company's website shop (taking photographs, uploading them, creating descriptions, adding products, etc).
Currently, we have to get help from our site's provider which of course costs money and time. Every time we have an issue with the site we have to email our provider and [I]hope[/I] they answer in the next two days (they are SLOW).
I don't need to learn how to create a site from scratch but it wouldn't surprise me if I had to know it to change anything presentation-wise. But what I'm asking is: where should I start? So far I'm reading up on this site: [url]http://reference.sitepoint.com/css/[/url]
I have total access to the root files via WebDAV; HTML, CSS and Javascript is what the site is running on (which I presume is a standard, anyway).
[QUOTE=Mooe94;42533455]I'm [B]very[/B] new to web development but I've been looking into it more and more because of my job which mainly involves me taking care of our company's website shop (taking photographs, uploading them, creating descriptions, adding products, etc).
Currently, we have to get help from our site's provider which of course costs money and time. Every time we have an issue with the site we have to email our provider and [I]hope[/I] they answer in the next two days (they are SLOW).
I don't need to learn how to create a site from scratch but it wouldn't surprise me if I had to know it to change anything presentation-wise. But what I'm asking is: where should I start? So far I'm reading up on this site: [url]http://reference.sitepoint.com/css/[/url]
I have total access to the root files via WebDAV; HTML, CSS and Javascript is what the site is running on (which I presume is a standard, anyway).[/QUOTE]
If you need to read up on something then I think [URL="http://htmldog.com/"]htmldog[/URL] is a pretty good site to look at.
Also CSS and jQuery is a must, so definately look into that!
- snip -
[IMG]http://oi43.tinypic.com/2i0vqmw.jpg[/IMG]
How can I make this look nicer?
[QUOTE=rbreslow;42536027]Change this:
[IMG]http://puu.sh/4R5fX.png[/IMG]
It's [B]horrible[/B].[/QUOTE]
I agree, to what?
Take a look at [URL="http://fortawesome.github.io/Font-Awesome/"]FontAwesome[/URL] and (more specifically) the directional icon section.
[IMG]http://puu.sh/4R73l.png[/IMG]
Above should help you with sizing.
- snip -
[QUOTE=rbreslow;42536416]Take a look at [URL="http://fortawesome.github.io/Font-Awesome/"]FontAwesome[/URL] and (more specifically) the directional icon section.
[IMG]http://puu.sh/4R73l.png[/IMG]
Above should help you with sizing.[/QUOTE]
I forgot about FontAwesome. Thanks for reminding me. I'll use it :smile:
[QUOTE=Epiclulz762;42536469][IMG]http://i.imgur.com/Kqc9whk.png[/IMG]
[editline]15th October 2013[/editline]
I don't know all the options you plan on providing your users.[/QUOTE]
That looks awesome! Thanks for the help.
[QUOTE=Epiclulz762;42536469][IMG]http://i.imgur.com/Kqc9whk.png[/IMG]
[editline]15th October 2013[/editline]
I don't know all the options you plan on providing your users.[/QUOTE]
This is much better, the arrow was annoying ;D
[QUOTE=Epiclulz762;42536469][IMG]http://i.imgur.com/Kqc9whk.png[/IMG]
[editline]15th October 2013[/editline]
I don't know all the options you plan on providing your users.[/QUOTE]
That actually looks awesome. [IMG]http://manolisvrondakis.com/image/done.png[/IMG]
[IMG]http://i39.tinypic.com/27x43ex.png[/IMG]
Why doesn't this look right to me?
[QUOTE=Coffeee;42542555][IMG]http://i39.tinypic.com/27x43ex.png[/IMG]
Why doesn't this look right to me?[/QUOTE]
text-indent to the paragraph?
I'm doing a php application and it's my first foray into web development
what's the best way to do a proper login setup? ideally it would be a 'remember me' type thing so the user doesn't log in every time
complete guide would be appreciated but I could google it myself if someone gives me a starting point
For this project you need:
php
-pdo
html
a database
[url]http://www.if-not-true-then-false.com/2012/php-pdo-sqlite3-example/[/url]
PDO example with prepared statements.
You will want to store the user's information in the database. If you do not prepare statements, users can delete your database, if you do not hash or encrypt passwords, a cracker can steal your database of passwords.
Save their info and a userID in your database.
When someone logs in start a session with their userID.
When you need to get data about them, you can use the userID in the database to see the data associated with them.
To make their login last a long time you want to create an .htaccess file that says how long their SESSION cookie lasts and you want to set the session cookie time parameter in your PHP script or in the php.ini.
You can set it to a very far time in the future if you need to.
[QUOTE=krail9;42547146]I'm doing a php application and it's my first foray into web development
what's the best way to do a proper login setup? ideally it would be a 'remember me' type thing so the user doesn't log in every time
complete guide would be appreciated but I could google it myself if someone gives me a starting point[/QUOTE]
Very simple/secure setup:
1 table (users), 4 database columns (id, username, password, token)
At registration, insert username and HASHED password (you can simply use password_hash() if on PHP 5.5, else I would suggest [url=http://www.openwall.com/phpass/]PhPass[/url])
At login, get the user via the username they supplied and verify password hashes match
Then create a some sort of session variable which indicates that they are an authenticated user
If the client requests to be "remembered", generate a RANDOM token to insert into the user's db row and then forward the same value as a cookie to the user
On every request: if the user is not logged in and the cookie exists, authenticate using the token
At logout, destroy the session and token cookie and set the token to null or empty string in the database
[QUOTE=jetboy;42547801]Very simple/secure setup:
1 table (users), 4 database columns (id, username, password, token)
At registration, insert username and HASHED password (you can simply use password_hash() if on PHP 5.5, else I would suggest [url=http://www.openwall.com/phpass/]PhPass[/url])
At login, get the user via the username they supplied and verify password hashes match
Then create a some sort of session variable which indicates that they are an authenticated user
If the client requests to be "remembered", generate a RANDOM token to insert into the user's db row and then forward the same value as a cookie to the user
On every request: if the user is not logged in and the cookie exists, authenticate using the token
At logout, destroy the session and token cookie and set the token to null or empty string in the database[/QUOTE]
Sessions use cookies and can have expiry dates so they're overall a better choice than a normal cookie.
[QUOTE=01271;42547854]Sessions use cookies and can have expiry dates so they're overall a better choice than a normal cookie.[/QUOTE]
My example does use sessions. The only time you'll end up with a cookie (that is not the session id) is if you tick "remember me", which is how it should be.
Anyone had any experiences with HostNine / A Small Orange?
thanks guys that's very helpful
Someone have an example for me for this:
I want a bounce in effect for small pictures, for example
You Type your nickname in a registration form, when the name is acceptable I want an little hook with a bounce in.
I don't know the English word, hook was the first I found, here a picture what a hook should be^^
[IMG]http://www.chryslerfreunde.de/stammtisch/media/haken.gif[/IMG]
Could anyone create a little code in JS wich creates an house with user submitted data. House has to be just a rectangle and triangle basically. Thanks!
[QUOTE=koppel;42551148]Could anyone create a little code in JS wich creates an house with user submitted data. House has to be just a rectangle and triangle basically. Thanks![/QUOTE]
We wont do your homework for you.
[QUOTE=Jelly;42551296]We wont do your homework for you.[/QUOTE]
Well I actually got it done already, I just slept in and was in a hurry. Sorry for asking.
[QUOTE=aehm ?;42550878]Someone have an example for me for this:
I want a bounce in effect for small pictures, for example
You Type your nickname in a registration form, when the name is acceptable I want an little hook with a bounce in.
I don't know the English word, hook was the first I found, here a picture what a hook should be^^
[IMG]http://www.chryslerfreunde.de/stammtisch/media/haken.gif[/IMG][/QUOTE]
Javascript + jquery + PHP + database.
[url]http://net.tutsplus.com/tutorials/javascript-ajax/5-ways-to-make-ajax-calls-with-jquery/[/url]
You need to use AJAX (javascript + jquery) and send a request to a php script on your server.
The php script will take in the name, check your database of names and if it is acceptable it will echo TRUE.
If the javascript returns TRUE, show the hook, if it is FALSE show an X.
(you do not need to use php, use whatever language you use.)
Sorry, you need to Log In to post a reply to this thread.