-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
Yeah I know the type you mean. There's a lot of plug-ins for jQuery for this type of thing - check out ThickBox.
-
Way I perceived it was a 'hits today' kind of counter.
-
There's no native support for this in JavaScript, however it has a property within the window.location object called search. You can use regex to match() and return the needed part of the string: var myParameter = window.location.search.match(/myParameter\=([^&]+)/)[1]; If this is something you plan to use multiple times I'd convert it into a function.
-
Perhaps suggest to SMF they should incorporate a fix for this in their next release?
-
It's not always about the performance; PDO was designed to provide a single interface between different database platforms. This may not be a concern for you, but for larger businesses or sites that use multiple platforms it's a huge bonus. Prepared statements are faster than normal queries because they're optimized for repeat queries with different parameters - a query run once will not see the benefit. If prepared statements are not supported for a particular database engine, PDO will emulate the behaviour. The MySQLi vs. MySQL extensions is a heavily disputed topic. MySQLi offers more functionality like an optional object orientated interface, however the results between performance vary on the type of query, set-up of MySQL, etc. It's kind of up to your own initiative to choose the right extension for you.
-
What does the JavaScript look like once rendered?
-
Do you want an actual browser window pop-up, or a HTML pop-up displayed with JavaScript?
-
Your comments don't really make sense and I have no idea why there's a check for "el2", but you just need to change the assignment parameter from "+=" to "=". "+=" means to append, where as "=" means take the value of.
-
Creating a new record and then updating it. What's wrong here?
Adam replied to facarroll's topic in PHP Coding Help
You have a comma after the last update value: (..)egroup6 = '$egroup6', WHERE equip = '(...) By the way you may want to look into an UPSERT statement here. -
If you're able to set up a cron job, you can easily call a Shell file once a day at midnight that will truncate the table you store the counter value in - or the file if it's file based.
-
That code works for me no problem. My guess is that the problem is elsewhere; possibly the web server. Try the code below in a file of it's own: <?php phpinfo(); ?> If you still see a blank screen you don't have the server configured correctly.
-
That fails to cover:
-
In most cases it are PHP (junior) developers who convert PSD documents to HTML/CSS not the designers. Unfortunately not in my case, though that is a good point.
-
First up, hashing is one way. You cannot "un-"hash md5, sha1, etc. Encryption is what you're after. Though it'll be impossible to accurately encrypt/decrypt something with as few characters as that at as there'd be too many possible collisions; how would you know which is the right decrypted value if multiple values evaluate to the same string?
-
Yes but they're designers, and as such are used to HTML tags with attributes. Implementing a template language that is based on attributes will be a lot easier for them to pick up.
-
It's because you're echoing out the string within print_button(), you should return it.
-
I wouldn't over-list all the little things you've done, as it may give the wrong impression that you're incapable or lacking experience for working on larger projects. I'd list some of the most notable jobs you've done; provide links and information, a contact for a reference, etc. Then say that you're able to provide more examples of your contract/freelance work upon request.
-
Senior PHP Developer Position Interview Questions
Adam replied to hadoob024's topic in Miscellaneous
I'm pretty sure the position has probably been filled. --- What ever happened to nadeemshafi9? That guy was nuts. -
True story. Yeah, you could even say it's a fact?
-
Thanks Zyx, just the refreshing kind of answer I was looking for. I have to disagree with you ProjectFear that PHP is cleaner, at least from the designer's point of view. Consider the following (admittedly overly simple) example which will just output an array of data - say a list of names - in a table: <?php foreach ($names as $name) { ?> <tr> <td><?php echo $name['last']; ?></td> <td><?php echo $name['first']; ?></td> </tr> <?php } ?> Of course that may look straight forward to you, but then again you know PHP. However, from the designer's point of view remember, take a look at the TAL alternative: <tr tal:repeat="names name"> <td tal:content="name/last"></td> <td tal:content="name/first"></td> </tr> Much simpler in my opinion. For the sake of argument we'll also include the SMARTY version: {foreach from=$names item="name"} <tr> <td>{$name.last}</td> <td>{$name.first}</td> </tr> {/foreach} Even the SMARTY version looks more complex than the TAL version. Of course you can argue that's a very basic example, but then again if it gets more complex with TAL it's without a doubt going to be more complex within the PHP/SMARTY anyway.
-
mysql_fetch_array only returns 1 row at a time, you need to loop through it: while ($emp = mysql_fetch_array($empget)) { print_r($emp); }
-
In your second code example you're overwriting the 'obj' variable each time you get an element. Rather than manually creating each element though, just use a loop that will iterate through each of the inputs: function togglePass() { var i = 1; while (document.getElementById('pass'+i)) { var obj = document.getElementById('pass'+i); if (obj.type == 'text') { obj.type = 'password'; } else { obj.type = 'text'; } i++; } } By the way I was trying to get a solution working that used an array within the name attribute for each input, but ran into more troubles than it's worth.
-
You need to define $alt outside of the loop, otherwise at the start you set it back to the same value every time.
-
That just concatenates (joins the variable and string together to make one string) and stores in the params variable.
-
Problem with classes on different pc's but not webhoster
Adam replied to kbloem's topic in PHP Coding Help
Try: include './pagination.class.php'; It may be that the include path is been overwritten and not correctly including the same directory.