Web Development Questions That Don't Need Their Own Thread v2
3,079 replies, posted
[QUOTE=high;31433163]Anyone know of a guide for optimizing php? With only about 60-100 people on my site at once the load shoots up. Also whenever a page is requested you can see php shoot up to 20-50% cpu usage. I did install xcache but is there anything else that can be done to help?[/QUOTE]
also, simply installing xcache will do nothing, you have to make your scripts actually use it. I would imagine that if you used it well it would significantly reduce server load.
[QUOTE=H4Z3Y;31444541]also, simply installing xcache will do nothing, you have to make your scripts actually use it. I would imagine that if you used it well it would significantly reduce server load.[/QUOTE]
Are you sure? I have XCache installed on two of my webservers and there is nothing I know of that is made to use it on one of them, unless WordPress does, but the cache gets filled up by something.
XCache on my other webserver is used by phpBB though and it improves performance a ton, here's a SS:
[IMG]http://i.imgur.com/tokNb.png[/IMG]
[QUOTE=Sc00by22;31446987]Are you sure? I have XCache installed on two of my webservers and there is nothing I know of that is made to use it on one of them, unless WordPress does, but the cache gets filled up by something.
XCache on my other webserver is used by phpBB though and it improves performance a ton, here's a SS:
[IMG]http://i.imgur.com/tokNb.png[/IMG][/QUOTE]
oh, I might be wrong then... i remember the only time I used XCache I had to have a wordpress plugin that would utilise the functions of XCache properly...
[QUOTE=H4Z3Y;31448057]oh, I might be wrong then... i remember the only time I used XCache I had to have a wordpress plugin that would utilise the functions of XCache properly...[/QUOTE]
I think that's just for the variable cache
What are some reasonable rates for working with clients? For example, creating a Wordpress theme from scratch, a simple database application (just input and output data), and designing web pages.
[QUOTE=R1Z3;31465306]What are some reasonable rates for working with clients? For example, creating a Wordpress theme from scratch, a simple database application (just input and output data), and designing web pages.[/QUOTE]
Creating a custom wordpress theme, I'd charge around £1000+ because it's a hell of a lot of work
Simple database interaction would be a few hundred probably and just designing pages would be around 80 quid per page, I dunno
[QUOTE=Alcapwne;31465433]Creating a custom wordpress theme, I'd charge around £1000+ because it's a hell of a lot of work[/QUOTE]
You are joking right?
Could someone summarize to me what Wordpress is and why I should use it over standard HTML/CSS/PHP/JS?
Wikipedia didn't give me too much info on that.
[QUOTE=NotMeh;31467194]Could someone summarize to me what Wordpress is and why I should use it over standard HTML/CSS/PHP/JS?
Wikipedia didn't give me too much info on that.[/QUOTE]
Wordpress is a very extendible blog platform. It has a vast array of plugins, addons etc availible for it. The reason you should use it because it takes the hastle out of writing something like it yourself.
[quote]
Creating a custom wordpress theme, I'd charge around £1000+ because it's a hell of a lot of work[/quote]
Wat
[QUOTE=Sc00by22;31467160]You are joking right?[/QUOTE]
Erm creating a wordpress them from scratch is a lot of work, unless he meant customising a wordpress theme which would be cheaper obviously
[QUOTE=Alcapwne;31467577]Erm creating a wordpress them from scratch is a lot of work, unless he meant customising a wordpress theme which would be cheaper obviously[/QUOTE]
No it's not.
1) Convert design to HTML + CSS
2) Copy and paste HTML into a blank WordPress theme, such as Starkers
3) Done
[QUOTE=Sc00by22;31467707]No it's not.
1) Convert design to HTML + CSS
2) Copy and paste HTML into a blank WordPress theme, such as Starkers
3) Done[/QUOTE]
Yeah, that's a lot more than just a normal website isn't it?
[QUOTE=Alcapwne;31467783]Yeah, that's a lot more than just a normal website isn't it?[/QUOTE]
What, copying and pasting? It takes about 10-15 minutes to do that, I know because I've done it several times :suicide:
[QUOTE=Sc00by22;31467848]What, copying and pasting? It takes about 10-15 minutes to do that, I know because I've done it several times :suicide:[/QUOTE]
Oh, it always seemed really complicated to me :v:
Does anyone use Aptana Studio in a git workflow? I can't seem to get it to authenticate with my git server, but msysgit works absolutely fine. I've put my id_rsa and id_rsa.pub keys in both users/luaduck/.ssh and users/luaduck/ssh (as some places suggest) and it still comes back and asks me for a password (which of course I can't give it because the git system user has no password, it only accepts SSH keys). The very same keys work in standard git.
[QUOTE=leach139;31468957]Does anyone use Aptana Studio in a git workflow? I can't seem to get it to authenticate with my git server, but msysgit works absolutely fine. I've put my id_rsa and id_rsa.pub keys in both users/luaduck/.ssh and users/luaduck/ssh (as some places suggest) and it still comes back and asks me for a password (which of course I can't give it because the git system user has no password, it only accepts SSH keys). The very same keys work in standard git.[/QUOTE]
[url=http://blog.mfabrik.com/2011/07/12/using-github-with-eclipse-to-update-collective-developermanual/]Here's something[/url]
Not sure if the same thing applies for Aptana, but hopefully it helps.
[QUOTE=Sc00by22;31467160]You are joking right?[/QUOTE]
If you're actually designing custom wordpress themes for less than that I will probably laugh at you. Think about how much design work goes in to a well done blog design.
kids here don't have living expenses so they can do cheap and nasty shit
-snip-
fixed it
Wanna get an opinion on an Appsumo offer.
Essentially 69$ for loads of lectures on Javascript.
[url]http://www.appsumo.com/introduction-to-javascript-special/[/url]
Limping through java, I'm trying to grab certain images recursively.
This code is provided with the script I'm modifying, I'm trying to figure out what exactly its doing, can someone explain the math here? I'm assuming its just grabbing one image after another, but I really don't understand it.
[CODE]url('/public/images/big/"+((e.y)+1)+".jpg')[/CODE]
Thanks in advance.
[QUOTE=tinos;31494129]Limping through java, I'm trying to grab certain images recursively.
This code is provided with the script I'm modifying, I'm trying to figure out what exactly its doing, can someone explain the math here? I'm assuming its just grabbing one image after another, but I really don't understand it.
[CODE]url('/public/images/big/"+((e.y)+1)+".jpg')[/CODE]
Thanks in advance.[/QUOTE]
it adds one to e.y, adds the result to a string, and puts it through the url() function?
[QUOTE=Ac!dL3ak;31494453]it adds one to e.y, adds the result to a string, and puts it through the url() function?[/QUOTE]
Thanks, I've looked at the image folder it's pulling from and they are simply numbered 1.jpg...20.jpg
Do you know what the e.y does/ stands for exactly?
[QUOTE=tinos;31494667]Thanks, I've looked at the image folder it's pulling from and they are simply numbered 1.jpg...20.jpg
Do you know what the e.y does/ stands for exactly?[/QUOTE]
no
Can anyone give me a hand with PHP's in_array function?
I've got this code
[php]
if(empty($_POST['outsourcing'])){
echo "<div class=\"answerIncorrect\">Did not complete</div>";
} else {
if(in_array($_POST['outsourcing'], $OutsourcingAnswerArray)) {
echo "<div class=\"answerCorrect\">". $_POST['outsourcing']. "</div>";
$updateCredits = mysql_query("UPDATE `users` SET credits= credits + 1 WHERE id='". $userID ."'");
}else{
echo "<div class=\"answerIncorrect\">". $_POST['outsourcing']. "</div>";
}
}
[/php]
In the array:
[php]
$OutsourcingAnswerArray = array("different company", "different", "giving work");[/php]
When I enter a single row in the array i.e. I enter "giving work", it works fine and will do the query. However, if I enter multiple rows i.e. "Giving work or giving work to a different company" in the textbox, it will echo the error. Does anyone know how I would go about checking if $_POST contains multiple rows in the array?
[QUOTE=twenty;31503211]Can anyone give me a hand with PHP's in_array function?
I've got this code
[php]
if(empty($_POST['outsourcing'])){
echo "<div class=\"answerIncorrect\">Did not complete</div>";
} else {
if(in_array($_POST['outsourcing'], $OutsourcingAnswerArray)) {
echo "<div class=\"answerCorrect\">". $_POST['outsourcing']. "</div>";
$updateCredits = mysql_query("UPDATE `users` SET credits= credits + 1 WHERE id='". $userID ."'");
}else{
echo "<div class=\"answerIncorrect\">". $_POST['outsourcing']. "</div>";
}
}
[/php]
In the array:
[php]
$OutsourcingAnswerArray = array("different company", "different", "giving work");[/php]
When I enter a single row in the array i.e. I enter "giving work", it works fine and will do the query. However, if I enter multiple rows i.e. "Giving work or giving work to a different company" in the textbox, it will echo the error. Does anyone know how I would go about checking if $_POST contains multiple rows in the array?[/QUOTE]
[php]
<?php
if(strstr($_POST['value'], "\r\n")):
$_POST['value'] = explode($_POST['value'], "\r\n");
foreach($_POST['value'] as $line):
if(in_array($_POST['value'], $arrayofanswers)):
echo 'It\'s there';
elseif:
echo 'Not there';
endif;
endforeach;
endif;
[/php]
Something like that?
You could just remove the newline character or instead of using a textarea use an input type text.
Going into secure password hashing with PHP. I'm going to be transferring passwords client > server plaintext with HTTPS, so that should be okay, but I'm wondering what I should do when it comes to storing passwords on MySQL. What I'm thinking is:
[code]Store passwords:
SQL / PHP: INSERT INTO generic_mc_table VALUES('$formuser','crypt($formpass)')
Check passwords:
PHP: if (crypt($formpass, $sqlpass) == $sqlpass) {echo("Bingo");}[/code]
Is that a reliable and secure way to do it, or is there some master race of hashing I'm missing out on?
[QUOTE=leach139;31532422]Going into secure password hashing with PHP. I'm going to be transferring passwords client > server plaintext with HTTPS, so that should be okay, but I'm wondering what I should do when it comes to storing passwords on MySQL. What I'm thinking is:
[code]Store passwords:
SQL / PHP: INSERT INTO generic_mc_table VALUES('$formuser','crypt($formpass)')
Check passwords:
PHP: if (crypt($formpass, $sqlpass) == $sqlpass) {echo("Bingo");}[/code]
Is that a reliable and secure way to do it, or is there some master race of hashing I'm missing out on?[/QUOTE]
I use the HMAC variant of the SHA512 hashing algorithm, and store it that way
[editline]4th August 2011[/editline]
unless i misunderstood your question
[QUOTE=Ac!dL3ak;31532523]I use the HMAC variant of the SHA512 hashing algorithm, and store it that way
[editline]4th August 2011[/editline]
unless i misunderstood your question[/QUOTE]
I'd prefer to avoid storing a static salt in a static location unless I absolutely have to, as a last defense if someone got file access (this is probably sounding incredibly stupid)
I want to put a 1 pixel border around certain images on my webpage. In the CSS I have
[code]
#gallery img {
width: 150px;
height: 150px;
border: 1px solid #000;
}
[/code]
And in the html I have
[code]
<img id= "gallery" src = "gallery/thumb1.png" />
[/code]
But it doesn't work, anyone help me with this basic question?
Sorry, you need to Log In to post a reply to this thread.