I am creating a form for my employer, and the person I'm working with sent me an email with this request:
For second presenter and third presenter can you please design a way to not have this information present unless the user specifies there will be more than one presenter? Maybe there can be a way to add a click button for the user to click to add information about the second presenter.
I have no idea how to accomplish this. Any ideas? Thank you so much!
In a Spanish portal we have, we are getting a lot of email and comments spam written in Chinese that comes out as glibberish. I've been trying to find a way to block it by blocking messages not written in latin charsets but I can't find exactly how. Do you have any idea, please? The problem is getting out of hand.
What's the approriate way to do plurals in PHP with/without a template system?
For example, you have the variable $num, and you want to echo out You have $num peaches. Or something. Right now I do: echo 'You have ' . $num . ' peach' . ($num!=1 ? 'es' : '') . '.'; but I can imagine that's not the proper way to do things.
Sure, it's not a problem for most of us, but I'm considering switching to a template program of sorts soon, and wonder if there is a standard we should be following
I've gotten into a syntax argument with a friend/coworker of mind over the code style I use. To be exact, how I format strings to be printed to the browser.
In my defense, I argue that the below is better for the longer term because it's easier to change/add to the formated string this way.
And he argues that it will slow PHP down having to
Instead of trying to roll my own solution, anyone know of a reliable IMAP/POP mail reader to be used in the back end of a website. What I am doing is dedicating a email account on the server to receiving incoming articles. On the command of the web Admin or a crontab script, the email's would be parsed/validated, with emails not from another account on the website being ignored, and then checking for something like "@PASSWORD='password'" on the first line. If thats passes, any embedded, attached img's would be parsed into jpg/png, the email body would be copied into a .htm file, and then authorized by the web admin.
The reason for doing this is that a lot of the content writers are clueless about HTML/CSS so I want to make it really easy for them to be able to publish articles onto the website using something simple like a email client as a WYSIWYG editor. I am going to use a fairly long email account name to try and avoid random spam and put in filter to reject any email that doesn't originate from the same server. Otherwise I am putting the KCEditor in the admin section as a another way of writing up articles.
My employers are in the process of opening up a PHP position in the DC area. The position in question is on a team responsible for developing sites, a CMS and other web tools for several magazines, some of which are relatively high-profile.
At present, I don't have any details regarding salary, etc -- but as far as I can tell, this would be a permanent position, and they do pay well, treat their employees well, and they are growing at what I think is a sustainable clip.
Skills I know we'll be looking for: PHP (5+, some OO preferred, Zend Framework a plus) PostgreSQL CSS Javascript (we'll be using the jQuery library) DBA skills a big plus Red Hat skills a plus
This is just a heads-up for the moment -- I'll put the actual job-posting here when it is approved, but for now if you're in the area and are looking for an opportunity, now would be a good time to dust off the old resume and update it.
Hello everyone, I was thinking about starting a new web app to teach myself php. I was wondering if anyone had a good recommendation for a php IDE for Linux. Code completion, coloring, symbolic debugger are a must. I don't necessarily mind if I have to pay for one, as long as it is worth the money. I've googled and found many, but I wanted to ask the community for personal preferences...
Unlike many of my past posts, this post is purely about how I want something to look without trying to implement it in a clunky, conditional manner.
Plus, I'm sure I've seen this before (though it's possible it wasn't in PHP).
What function, if any, will put the appropriate...suffix, I guess...on a numeric input?
For Example: Putting the st on 1st or the nd on 2nd.
Small Disclaimer: I know I could look this up myself. I'm perfectly capable of searching php.net or google.com, but the fact is...I'm not entirely sure what this is called. "Suffix" was the closest I could even remotely come. So along with possibly giving me the answer to my question...letting me know the name of what I'm asking about would be helpful as well. :D
Maybe I am nutts or excessive when it comes to security, but I've been noticing that no one else leaves traps and alarms when dealing with user input from the client. What I mean by traps is the below:
...
...
The first thing I check before validating input is this debugOn variable... if it's anything else besides "off", all of the input is serialized and logged with the offending client IP to a suspect log which is then checked every 10 minutes by a cron Job. If the suspectLogger cronjob counts more then 3 events against a IP, that addressed is blocked or redirected to a static html page.
Another good one is when I am passing ID via get/post from one page to the next. If on the next validation the record ID doesn't match the stored IP address and their domain isn't aol.com or doesn't have the word proxy in it somewhere, a suspect event is logged and they're redirected back to the originating form with a message saying there is a mismatch between their IP address and record number.
So far every idea I've come up with that I thought was original, someone thought of five years ago or has been unfeasible, so I wonder why no one else does this, it was pretty easy to setup.
Before I call it a night, I figured this might be useful for someone on here. It's a fairly well thought out discussion on patterns, what they are and why they can be beneficial for developing complex applications. http://martinfowler.com/articles/writingPatterns.html
Debating adding more certifications to my resume. I have a big chunk of my MGIB military scholarship left over to pay for it, so there would be no out of pocket expenses on my part... just curious if it will be atleast educationally redeeming and something to help me stand out more in the market.
Is there a way to force the PHP environment to require declarations of variable's prior to their use? I've been making some stupid mistakes/bugs in my code and I want to make a stricter environment to keep myself in line.
This is a very simple trick I came up with for my test environment at home. It's used with Apache 2.* with the virtual host module loaded in httpd.conf and a virtualhost.conf file included at the end.
The trick is this:
Say you have your virtual host sites in this directory structure.
/websites/users/myDomain.com/public_html/
At /websites/ create two junctions/links to /websites/users/ /websites/php4 -> /websites/users/ /websites/php5 -> /websites/users/
Now use the following conf file. ScriptAlias /php4/ "d:/wamp/php4/" ScriptAlias /php5/ "d:/wamp/php5/"
Options Indexes FollowSymLinks AllowOverride all Order Deny,Allow Deny from all Allow from 127.0.0.1 #Tell php where to find INI settings SetEnv PHPRC "d:/wamp/php4" #Tell Apache to process this mime with this CGI parser Action application/x-httpd-php "/php4/php.exe"
Options Indexes FollowSymLinks AllowOverride all Order Deny,Allow Deny from all Allow from 127.0.0.1 #Tell php where to find INI settings SetEnv PHPRC "d:/wamp/php5" #Tell Apache to process this mime files with this CGI parser Action application/x-httpd-php "/php5/php-cgi.exe"
#Tell's apache files of this type are php mime type
AddType application/x-httpd-php .php .phtml .php3 #if a broswer calls the server with http://php(4||5).myDomain.com it parses out to #d:/website/php(4||5)/myDomain.com/public_html/
So now when you setup your hosts or local DNS server, you can run the same website/application in either environment by changing out the subdomain. And further more, there is no way to mistake what environment your in or the need to have multiple copies of websites. Best of all, you can make other junction/links and Directory statements in Apache so you could test your site on just about every version of PHP there is.
I tested this out on XP 64, but because the idea is universal, it should work on *nix environments as well. I made a project log of setting this up along with phpDocumentor and subversion, so if anyone is interested just contact me.
I'm writing a little php app for which I'll need to be able to create a trendline from a set of data. Does anyone know of a free (preferably open source) library that can do such a thing in PHP?
Also, does anyone know of a library that I can use to work with matrices (the math kind) in PHP? EDIT: I just ran across PEAR::Matrix. Have any of you used this with success (or not)?
I found this in a open source package, which I won't disclose. Amazingly enough, in the phpDoc comments, the author was proud of this and boasting of their l33t skills. It horrified me.
function myFunction($myObject, ... other params) { ...Code code Code //WTF? $this &= $myObject; }
I can kind of see how someone would even think of using this, but it still scares me.
Anyone else have problems with 1.3 release of phpDoc? I broke the mantra of "if its not broken, don't fix it" and updated to 1.3 this morning and now phpDoc has been very, very buggy. Its almost like they didn't even test this thing before marking it as a release/stable version.
Update: I rolled back to RC3 and its working again, but only using command line, which isn't so bad.
I know what the & operator does - it makes a variable passed by reference. So when you do
function (&$arg) {
$arg = !$arg;
}
EDIT I think that's the worst function I've ever written. Try running it. Everything is null.
pretend I did this instead:
function foo(&$arg) {
$arg++;
}
/EDIT
$arg is changed to logical false incremented in the scope that you called the function from. I've seen this syntax a lot lately - and I'm trying to figure out what the meaning is:
function & ($arg) {
//statements
}
What does this to to the function? what does it do the the value of $arg?
With their refusal to upgrade to php5 and let you install any kind of third party software they have effectively rendered themselves useless to me. With that said, does anyone know of any good hosting providers with ssh access? I'm wanting to use smarty, and play around with the Zend framework so I need php5. Also need some databases, I don't know if the free sql databases were just a godaddy thing or not, I hope not. thanks.
Anyone else notice that a lot of major servers seem to be straining under load in the last couple days. My ISP through put dropped down to 15k from its normal average of 1.5megabit so I didn't notice right away but its getting kind of weird. I've gotten a lot of temporary 500 errors on sourceforge.net, google.com, wikipedia, youtube.com, and a couple other major sites that I know use clustering. Maybe I am just seeing things, but it looks like emergency maintenance is being done on the public/production servers which is unheard of to me...especially for the eggheads at google.
I'm planning to write a cross-posting module fo Drupal. The idea is that when a member on the Drupal site updates her blog, the entry is cross-posted to her livejournal. The database structure and interaction I can handle, but I'm a little confused about what to do for the client code.
My plan is to use the XML-RPC interface to Livejournal, and code the client in PHP. I could use the base interface, but I'm wondering if anyone has written a library that might speed up my development. Does anyone have any suggestions?