[QUOTE=zzlawlzz;33000171]do htmlspecialchars FIRST then do the string escape
[editline]28th October 2011[/editline]
After reading the user guide for code igniter, I think i'll like this. :v:[/QUOTE]
the user guide for CI is much more understandable than Kohana, in my opinion.
[QUOTE=Ac!dL3ak;33000371]the user guide for CI is much more understandable than Kohana, in my opinion.[/QUOTE]
my head was spinning when i was trying to understand kohana.
[QUOTE=Catdaemon;33000337]Why are you manually casting it to string? It's definitely a string no matter how little you trust it. PHP automatically casts variables around as required - You should either declare the variable as a certain type or only use casting when you need to be absolutely sure it's a numeric data type. I don't think there's any circumstance that you need to manually cast to string in though. You can also re-use the same variables, makes it a bit easier to figure out what's going on.
Here's how I'd do it, you might want to look up the trim and empty functions.
[code]
<?PHP
$string = $_POST["text"];
mysql_connect("localhost", "no", "no") or die(mysql_error());
mysql_select_db("no") or die(mysql_error());
$string = htmlspecialchars($string);
$string = mysql_real_escape_string($string);
if (empty(trim($string)) {
echo "Error, please try again.";
} else {
$sql = "INSERT INTO `no`.`no` (`no`) VALUES ('$stringout3')";
mysql_query($sql) or die(mysql_error());
echo "Added!";
echo "</body>";
}
?>
[/code][/QUOTE]
The line with the empty(trim($string)) thing is throwing an error, I even added the ) after it.
Fatal error: Can't use function return value in write context in /home/oflfcxpf/public_html/guest/postreply.php on line 17
[QUOTE=toaster468;33000724]The line with the empty(trim($string)) thing is throwing an error, I even added the ) after it.
Fatal error: Can't use function return value in write context in /home/oflfcxpf/public_html/guest/postreply.php on line 17[/QUOTE]
you have to do
[code]
$trim = trim( $string );
empty( $trim )
[/code]
[QUOTE=Ac!dL3ak;33000800]you have to do
[code]
$trim = trim( $string );
empty( $trim )
[/code][/QUOTE]
Yeah I figured it out. But the trim function doesn't work for new lines in textareas.
[QUOTE=toaster468;33000724]The line with the empty(trim($string)) thing is throwing an error, I even added the ) after it.
Fatal error: Can't use function return value in write context in /home/oflfcxpf/public_html/guest/postreply.php on line 17[/QUOTE]
That's an issue/aspect of the empty() function, it requires a reference.
[code]<?PHP
$string = $_POST["text"];
mysql_connect("localhost", "no", "no") or die(mysql_error());
mysql_select_db("no") or die(mysql_error());
$string = htmlspecialchars($string);
$string = mysql_real_escape_string($string);
$string = trim($string);
if (empty($string) {
echo "Error, please try again.";
} else {
$sql = "INSERT INTO `no`.`no` (`no`) VALUES ('$stringout3')";
mysql_query($sql) or die(mysql_error());
echo "Added!";
echo "</body>";
}
?>[/code]
[editline]28th October 2011[/editline]
Welp, ninja'd.
[editline]28th October 2011[/editline]
Aaanndd now I'm pageking, great.
Joe can you inject SQL now?
[QUOTE=toaster468;33001027]Joe can you inject SQL now?[/QUOTE]
Looks good now. I can help you switch to PDO or MySQLi if you'd like, however.
[QUOTE=StinkyJoe;33001081]Looks good now. I can help you switch to PDO or MySQLi if you'd like, however.[/QUOTE]
Thank you. And yeah I'd like to learn one of those. But I have to do homework now, bye guys.
Never realised that about empty(). Then again I don't usually nest code like that. You learn something new every day, even in a 3am daze.
[QUOTE=StinkyJoe;33001081]Looks good now. I can help you switch to PDO or MySQLi if you'd like, however.[/QUOTE]
Just finish that PDO tutorial!
[QUOTE=anton;32990564]what are you talking about, hotmail is total shit[/QUOTE]
It's fine.
In-email ads got removed a while back, sweep is pretty handy, it's got threaded view as well, and I love having a three-column layout. Gmail Labs has a three-column layout but last time I tried it, it looked like an absolute trainwreck, so hopefully it'll improve.
The only thing I would like for Hotmail is for it to show some indicator when you click on something before the scripts are ready, because it's annoying to click on something and get no response.
[code]
$(function() {
var offset = $("#blur").offset();
var topPadding = 55;
$(window).scroll(function() {
if ($(window).scrollTop() > "55") {
$("#blur").stop().animate({
opacity: 1
});
} else {
$("#blur").stop().animate({
opacity: 0
});
};
});
});
[/code]
Found this shitty jQuery code for the scrolling thing, makes the blur appear once header is non-visible (header is at height of 55px)
[QUOTE=a2h;33005498]It's fine.
In-email ads got removed a while back, sweep is pretty handy, it's got threaded view as well, and I love having a three-column layout. Gmail Labs has a three-column layout but last time I tried it, it looked like an absolute trainwreck, so hopefully it'll improve.
The only thing I would like for Hotmail is for it to show some indicator when you click on something before the scripts are ready, because it's annoying to click on something and get no response.[/QUOTE]
Worth reiterating that my original point was about email rendering, not UX/UI.
Apparently people think gmail is better, despite facts proving otherwise.
Oh well, even Yahoo and AOL mail are better than gmail.
There needs to be a new email spec that includes HTML5 and CSS3.
[QUOTE=Jelly;33005643]There needs to be a new email spec that includes HTML5 and CSS3.[/QUOTE]
Yeah, but just supporting stuff like stylesheets and divs would be nice.
Microsoft seems to be in a good position to do something like that, they haven't really done anything crazy spectacular or innovative recently.
Yeah, Outlook still has a pretty dominant market share, it's perplexing that Outlook 2007 uses the Word engine to render HTML.
Apparently they're paying some attention though: [url]http://www.email-standards.org/blog/entry/microsoft-prove-theyre-listening/[/url]
Getting proper HTML/CSS support in their next Outlook iteration would definitely bring a lot of designers back to supporting Microsoft.
[url]http://litmus.com/resources/email-client-stats[/url]
Wow, this makes me sad
What were you expecting?
I need to convince my boss to get me a Litmus license.
[QUOTE=a2h;33005498]It's fine.
In-email ads got removed a while back, sweep is pretty handy, it's got threaded view as well, and I love having a three-column layout. Gmail Labs has a three-column layout but last time I tried it, it looked like an absolute trainwreck, so hopefully it'll improve.[/quote]
Gmail's threaded view is impossible for me to read because of the huge lack of visual separation and icons.
The only thing I would like for Hotmail is for it to show some indicator when you click on something before the scripts are ready, because it's annoying to click on something and get no response.[/QUOTE]
A little "Loading..." box pops up at the bottom when loading.
[editline]28th October 2011[/editline]
[thumb]http://www.gabrielecirulli.com/p/20111028-164348.png[/thumb]
Holy crap.
Why do Debian/KDE have to look so ugly. I really can't get myself to use them, the only decent looking one is Ubuntu.
[t]http://puu.sh/7IKp[/t]
There's nothing wrong with it. It just needs a little work, kind of like windows, that's fugly out of the box.
Still looks pretty bad to me. I think the inconsistent/inadequate spacing on some things is the main issue (take the distance between those icons on the sidebar and the edge of the window for example).
It's because many Linux distro's usually go for function over form. Making stuff look pretty takes time and they just want to improve all the underlying shit.
Let's all team up and design the perfect-looking (and working) Linux Distro.
:dance:
[editline]28th October 2011[/editline]
[thumb]http://gabrielecirulli.com/p/20111028-192301.png[/thumb]
See, this is already something I could work with. If the UI is ugly I keep noticing it and it distracts me from my work. Problem is just a theme won't fix it, it'd need structural changes. At least Canoical realized this and started caring for design other than functionality.
[url]http://www.omgubuntu.co.uk/2011/10/five-pretty-awesome-gnome-shell-themes/[/url]
[editline]28th October 2011[/editline]
Gnome uses CSS to add style, so it's not out our depth at all!
[QUOTE=jaybuz;33010304][URL]http://www.omgubuntu.co.uk/2011/10/five-pretty-awesome-gnome-shell-themes/[/URL]
[editline]28th October 2011[/editline]
Gnome uses CSS to add style, so it's not out our depth at all![/QUOTE]Gnome Shell must be pretty cool, I'm installing it right now. I hope the VM can hold its weight.
I thought Ubuntu already used the Gnome Shell and it looks like you're running Ubuntu.
[QUOTE=jaybuz;33010395]I thought Ubuntu already used the Gnome Shell and it looks like you're running Ubuntu.[/QUOTE]The one I posted the screenshot of is Unity, not Gnome Shell.
Sorry, you need to Log In to post a reply to this thread.