ManiacDan
Staff Alumni-
Posts
2,604 -
Joined
-
Last visited
-
Days Won
10
Everything posted by ManiacDan
-
trying to access an array's values, but can't.
ManiacDan replied to ballhogjoni's topic in PHP Coding Help
The problem is that you cannot chain array access in the form of [2] after a function call (which is fixed in a future version of PHP, as noted). The easiest way to do this is to simply make a getAttribute function on that class which would do $obj->getAttribute("username"); -
Probably not the right place to ask, but here it goes anyways
ManiacDan replied to thomasw_lrd's topic in PHP Coding Help
The variable $userfile contains the filename. -
1 Line of Code: Printing results of query but from encrypted AES
ManiacDan replied to phpretarded's topic in PHP Coding Help
This code you posted is not valid PHP and would throw parse errors. -
It's a featured of apache called mod_rewrite, it rewrites "pretty" URLs into "real" URLs
-
Eyebleach! Maybe a nicer color of yellow.
-
1 Line of Code: Printing results of query but from encrypted AES
ManiacDan replied to phpretarded's topic in PHP Coding Help
mysqlretarded, PHP and MySQL are two separate languages and cannot be mixed and matched like this. You must form a full and proper MySQL command and dispatch it to the MySQL server every time you wish to do anything. Make a correctly formed MySQL statement first, review the manual chapters if necessary, then come back. -
Having trouble pulling data from MySql db using PHP table.
ManiacDan replied to FoxRocks's topic in PHP Coding Help
Change your username and password immediately, they've already been seen by potentially hundreds of people, and 4+ web crawlers. -
VMs, some stand-alone servers, and then entire racks for staging (2 environments - 1 rack each) and production (1 environment, 4 racks)
-
Then imagine your code controls billions of dollars of real-time financial data, must be 100% secure from attacks, and is regularly audited by both government and private sector auditors.
-
1) he meant "try to read the manual and learn how to use the popen function" 2) Never ever ever, under any circumstances, EVER run user input through the shell without using escapeshellcmd
-
Practice makes perfect. Work your way through Project Euler, it will make you better at math and programming. It won't help you make large scale class systems or anything though, that only comes through trial and error, and observing other people's code. You can check out OSS projects like Symfony to see what a huge class system looks like, though I think they go overboard.
-
You have 1,000 select boxes named "Choose one" The NAME of an item in a form determines the name of the variable eventually posted to your PHP page. If the name is "selectOne" (never use spaces in form element names), then $_POST['selectOne'] will be your variable. You have nothing in here that tells your form WHICH item you're selecting. All you're passing back is the word "passed" inside "selectOne." You need a hidden form element in all of these forms which contains the itemID you want to modify. Then limit your update query to only that item ID.
-
I work for a payment gateway. For legal reasons, our progress has to be strongly packaged and released in very rare bundles. We have a team higher up the chain that delivers a prioritized list of items to us every other Monday. We do 2-week "sprints," finishing the 2-week block of tickets monday->friday, then we move the entire codebase as a block to the QA server, branch the codebase to sprint2, and start over on the next batch the following Monday. Meanwhile, QA tests sprint1 while we develop sprint2. The NEXT sprint, we work sprint 3 while QA tests sprint2 and the second round of QA re-tests sprint1 in our staging environment. We can go up to 20 sprints without a production release, all of the sprints piling up in the staging environment until we do a production push for all the sprints at once. Any bugs found by QA must be fixed in the sprint in which they were discovered (we have a rotating set of 3 development environments so we can back-fix up to 6 weeks back), and then forward-merged into any sprints "ahead" of the fix version. Yes, it's ridiculous.
-
Exactly 100% true. Ok, you got me. DRAWING A BOX AROUND AN INVISIBLE SPAN would make it visible. Congratulations, you've won.
-
Actually, no... my solution is the correct one. Yours will echo the error span whether or not there is an error. Wrong place for a ternary. Your original code was wrong (which is why OP said it didn't work). You've since edited it to be more correct. An empty span won't render or take up space, so it doesn't matter in the long run. Plus, some JS error handling requires the error span to already be present in order to be populated, so it's a good idea to have it there in case it's needed.
-
It's a customer portal for a payment processor. We're re-writing it to be "web 2.0" at the recommendation of various non-technical people and a terrible design firm. It's all ajax/json based, jquery as the front-end. I use firebug/webTools for basic JS debugging, though not often. The real heavy lifting takes place behind the scenes in Symfony, the JS is just for moving the interface elements around, doing basic validation, etc. For symfony debugging we just dump to the log file and tail it by hand. I do use the network inspector to monitor web requests, but that only really tells me if there was a 500 error. If so, I check the log file on the terminal.
-
This applies to businesses which exist in the UK regardless of where they're hosted.
-
When the user first visits your site, take them to a splash page that asks if they want to use cookies. If they say yes, proceed to your page. If they say no: 1) If your page cannot be used without sessions and cookies (like most pages), show them a "we're sorry, this site requires cookies" page and be done with it. 2) Otherwise, set a "no cookies" cookie (I believe, under EU law, you're allowed to use a cookie to track this no cookies setting). Then find every setcookie call, and wrap it in a check to see if the nocookie cookie is set. Make sure #2 is legal. If not...hmmm...no idea.
-
Joomla music collection "Invalid arguments passed in components"
ManiacDan replied to 1order's topic in Applications
$this->album->types is expected to be an array. It isn't. That's all we can tell you without direct access to your code. -
The solution to bad code is NEVER "turn off error reporting." Fix your code. Fix your code like this: <?php echo "<span class=\"error\">".(isset($_GET['message']) ? $_GET['message'] : '')."</span>"; ?> This snippet makes use of the ternary operator
-
But for many applications, there is no other part. My current application is 100% ajax based, the only time a debugger would be handy is in the drawing of the first pane and the loading of the JS asset. A previous company was all SOAP based, the only time a debugger would have been handy was in very basic template-level stuff.
-
AJAX and SOAP calls do not generally print human-readable output, and they cannot be linked directly to debuggers because they require custom request formats (not just GET).
-
Have you done any debugging on your own? If the form data doesn't seem to be posting, print out the post data and see for yourself. Your username isn't being set, so echo it out and check it. You cannot possibly fix a script simply by staring at it.
-
Thread moved to Miscellaneous, for want of a better section. I haven't used a debugger in years. Ajax, soap, and rest kind of make them useless. If you're writing a site where a debugger could come in handy, I don't think any less of you. I just use log files. Some people think they're "hardcore" if they go without a debugger, like driving a car without airbags or something. It's not the mark of a professional to forego debugging, it's the mark of someone who cares more about how he looks than how his code works. Write code however you, personally, can write the best code.
-
This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=360130.0