Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
[SOLVED] need advice on learning php please , php is my dream goal
Maq replied to silverglade's topic in Miscellaneous
It's definitely worth the work, it's pretty much necessary. What if you have users on your site and you break something? You're just going to let your users suffer while you're trying to fix it? No, you develop and test locally, once you're satisfied, push it live. -
[SOLVED] need advice on learning php please , php is my dream goal
Maq replied to silverglade's topic in Miscellaneous
but i dont see a point of installing a database on my own computer when i dont want my computer to be the server, You should be developing and testing on your local machine. Your local environment should mirror your live one. -
In your giant echo statement you should be using single quotes for the HTML attributes, as the first double quote is interpreted as the echo termination expecting a semi-colon.
-
In a tongue-in-cheek defense of Microsoft, one blogger suggested that the company was attempting to be all things to all people. "The white head and black hand actually symbolize inter-racial harmony. It is supposed to show that a person can be white and black, old and young at the same time."
-
note that when using str_pad(), you don't even need to check the string's length. no padding will be performed if the input string is equal to or greater than the pad length. Ah, yeah sorry about that. Thanks. $s = 8; echo str_pad($s, 2, "0", STR_PAD_LEFT);
-
$s = 8; echo (strlen($s)==1) ? str_pad($s, 2, "0", STR_PAD_LEFT) : $s; ?> Or, as Nightslyr suggested: $s = 8; echo (strlen($s)==1) ? "0" . $s : $s; ?>
-
Check out: str_pad.
-
http://www.belfasttelegraph.co.uk/lifestyle/technology-gadgets/microsoft-apologises-after-swapping-black-face-for-a-white-one-in-polish-ad-14472121.html
-
Please use tags. You have to learn about string formatting and interpolation. You're using double quotes for your string and attributes. The attributes should be using single quotes. {$row[id]} In the line above, you're using curly braces for no reason. Associative arrays are supposed to have single quotes around the keys and surrounding it with curly braces allows you to do that.
-
That's odd with OP's so well-formed and properly indented code? lol. Hopefully that was caused by a copy and paste or something...
-
Totally didn't even see that... If you want to order in descending order then you need to keep that clause in there but specify what to order by. ORDER BY [column_name] DESC LIMIT
-
echo''; Why did you decide to format this string differently, well ultimately incorrectly? You have to learn how to concatenate and format strings properly.
-
Before examining your code, turn error_reporting on by placing the following lines directly after your opening <?php tag: ini_set ("display_errors", "1"); error_reporting(E_ALL);
-
Most likely your query is failing. Echo out the mysql_error() or the query string to see what's actually going on.
-
Is this via RSS? Or is this content you already have? In which case you can just use a cron or scheduled task (windows).
-
Where is $mail defined? You sure it has a value...?
-
A simpler and safer solution would be to use SimpleXML. You can easily test for empty attributes, self-terminating elements, empty nodes, etc. with XPath.
-
This was actually a MySQL question, which I moved. If this is resolved please mark as so.
-
Then please mark as so.
-
I believe the "value" attribute is the default value. To make it blank when the user clicks in the field, you're going to have to use Javascript, specifically onFocus(). If this specific thread is solved, please mark as so and post this new question in the Javascript section.
-
That's good to hear. You have to initialize them like I mentioned before. Somewhere in the beginning of your script add: $x = 0; $construct = ""; EDIT: I realize you have error_reporting turned to max while in development, but when pushed live, error_reporting should be adjusted appropriately.
-
I just implemented the suggestions mentioned in that article and I definitely see performance improvements. Reducing the amount of RAM during minimization is one of my favorites. I would use Chrome, but it's still "in-progess" for Linux. It's clearly faster for browsing, but, like you said, for development environment I like FF support and plug-ins much better. Warning: Please read this reply for potential issues these modifications may cause: http://www.boygeniusreport.com/2009/01/25/a-handful-of-firefox-tweaks-that-will-double-your-browser-speed/comment-page-2/#comment-382958 EDIT: But after reading this reply, it may be well worth it. http://www.boygeniusreport.com/2009/01/25/a-handful-of-firefox-tweaks-that-will-double-your-browser-speed/comment-page-1/#comment-382827
-
Check out this note: http://us.php.net/manual/en/function.shell-exec.php#57215
-
You never initialize $x, but the script should still work properly. You never initialize $construct but the script should still work properly. These two notices won't hurt you but you the "$Job Type" variable won't display. Change all occurrences of "$Job Type" to "$JobType" (notice the space). I would highly encourage you to never use spaces, instead use underscores if you want to separate words in variable names. You can keep the key name in the associative array from the query the same, change only the PHP variables.