Have object property names always been case-sensitive? If not, in what version did that change? I seem to remember it being different before, but maybe I'm remembering method names, which are still case-insensitive.
A project I'm working on requires property names to be case-sensitive, and so I want to know whether that requirement makes my project depend on a minimum version of PHP.
1.) I'm trying to build a Query where you have condition 1 which is absolute (like foo = 'Bar') but then condition 2 which could have several options. This is how it looks:
What it is 'supposed' to do is pull up any records with company name of FOO that were entered by BOB, JOE, or KAT. But instead it's just pulling up all records entered regardless of the company_name restriction. What am I doing wrong here?
2.) Some of the company names use a & symbol which is wreaking havoc on the query. I've tried to use mysql_real_escape_string and addslashes but neither solve the problem; leaving a company name like R&F Cola reduced to a query search of R. How do I get MySQL to accept that the & is just part of the query?
Thank you so much to anyone who helps. I'm sure I"m missing something easy; but those are usually the most annoying ones!
You all are always a big help, so hopefully you won't mind my novice question... I've been searching through 2 books and the php.net site for the answer, but the problem is I'm not exactly sure what it is I'm searching for.
This may make no sense, but here's my question: I'm trying to write a code that shows a default link when the page loads initially, but once the person has visited that default link and reloaded the page a new link will appear in place of the original.
[ EDIT ] I'll try to rephrase. Basically, on the page there is an image and a link. I want the page to recognize, on refresh, that the link has already been visited so now it shows a new image and link. Is there a way to get the computer to return a true if the page has been visited and a false if it hasn't? (I'm helping a friend code this, so I can only explain it as best he explained it to me.)
I'm guessing it involves a true false statement and an if else statement, but I'm not entirely sure how to phrase it or what it should be looking for in order to return either true or false.
Hi! I'm in the process of installing DodosMail's form script in my site (that's clearly still in the making) and I had no problem with actually getting into the page. The only thing is, whenever I fill out the form to see if it sends the mail correctly, as soon as I click the "send" button, it opens Outlook for me to manually send the email. I'm guessing that's not how it should work, right?
test.php file
I haven't changed a single thing in the dodosmail.php file.
I have a sign up form which is working perfectly except for one thing; no matter how I phrase it, I cannot get an alert to display when a checkbox is unchecked. The code works perfectly for the textboxes that use it, but the checkbox won't behave. Is there a fundamental difference I'm missing here?
Here's two examples from the form; the company name part is working fine, but the terms simply won't register an alert.
Company Name: (*)
">
Please tick this box to confirm that you accept our terms and conditions.
function ValidateSignupForm(x){ if(x.company.value==""){ alert(""); x.company.focus(); return false; } if(x.terms.value==""){ alert("You must agree to our terms and conditions in order to join."); x.terms.focus(); return false; }
Any thoughts would be greatly appreciated. Thank you in advance.
I am a big fan of the xdebug extension for development purposes, but it doesn't appear to have one thing I am looking for...which is a function or method of dumping the memory foot print of individual class instances and other structures of a script. Specifically I am working on a proprietary framework in php 5 that out of the gate takes 1.8MB of memory per instance. This just kind of spooks me. I think one the bigger things taking up memory is the extensive use of output buffer and I've got some ideas of how to work around that...but before I make an experimental branch and start doing horrible things in the name of speed, I was hoping to be more informed. Oddly enough, there doesn't seem to be any base functions to get back a real sizeof result.
I've wrecked my setups enough times to be a pro at getting PHP, Apache, MySQL and Windows XP to all play together nicely. However, this time I'm running into a strange problem. I've got PHP 5.2.3 and Apache 2.0.59. Apache runs fine, PHP seems to run fine, phpinfo() shows everything as it should be. When I try to load anything that seems to have more than a single line in it, it doesn't look like it's parsing anything. I get a lot of broken bits of code showing on the screen. Things like '>' when used as operators are being parsed as HTML tags. These are scripts that ran fine on Sunday with Apache 1.0.3 and PHP 4.whatever. I'm having trouble deciphering exactly what it's doing or why, but it's obvious it's not working. I'm at an end here, for now. Anyone have any suggestions?
EDIT: Found it after staring at a script for half an hour. Know what it was? From PHP.INI:
short_open_tag = On
That was set to off. Of course I'm lazy and never actually type to start a script, however, my editor sometimes puts that in for me, which is why some scripts worked. I'd read about this setting, but never thought it might apply to me.
I'm using Timothy Groves' AJAX-based Auto Suggest script ( http://www.brandspankingnew.net ) on an in-house project, but am having some troubles (obviously). The default sample script offers fields for 'id', 'value', and 'info' which isn't so bad, but the project I'm working on is going to take one auto-suggest field, and fil in values for several texts. I'm not sure why, but I keep getting 'undefined' sets even though I'm parsing the variables.
So all that longwinded explanation can be boiled down to:
"I'm tring to have the PHP portion of this script parse more than 'id', 'info', and 'value' but the AJAX part keeps acting like it's all undefined. Please help me."
This is all assuming you've used Timothy Groves' script before, as I imagine other scripts do it differently.
I simply need a little clarification on the mysql_insert_id() function that is available in PHP.
The definition on PHP.net reads: "Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query." Is this ID the number that is created in a column I defined (with Auto increment enabled) or is this something else entirely?
Say I have a table with two columns: Column 1 = id_num (auto increment) Column 2 = name
I want to insert a new name into the table and let the value for id_num generate automatically. Easy, right? Can I then call the mysql_insert_id() function and have it return the value in the first column that was created, or does it return a value that mysql uses but nobody else would need?
and it seems to do the trick just fine on my unix-based host, and is actually pretty well done (easy to edit) etc, but when i upload it to the client's host, which is windows-based (yeah, i know) it won't connect to the payment bridge.
the script mentions this if you don't get a response from the host:
// 1) You may not be https or a secure connection to Authoriznet (SSL) // 2) It could also mean that you are not using port 443, the port required by Authorizenet // 3) You may not have the proper version of CURL installed that support SSL // 4) Curl may not be initialized // 5) Also, Apple OSX Server has a preference in the Web Server that defaults to "enable // performance cache" and this seems to throw requests to other ports rather // than their default assigned ones. Disable "performance cache" and restart the Web server.
i know #1 is correct because I'm using the shared ssl but i'm not sure about the others.
Unfortunatley we cannot offer any further advice on how to get authorize.net to work with our system.
Our system does work with authorize.net, however what permissions/ changes need to be done to get it to work, I cannot say.
I can confirm thatcURL 7.95 is installed on the server as well as the port 443 is being used for the shared ssl. We are a Windows operating system network and so the Apple Server would not apply.
You may wish to see if you need a ssl certificate that has the domain name on it to work with authorize.net.
If you have any further questions, please feel free to contact us.
--
i'm pretty much at a loss here. any help/insights would be appreciated as i don't think this client will want to switch hosts.
I’m writing a semi complicated (to me!) piece of code that will take input from a user (Form), and depending on what had been entered, do something with it.
I’d like to put it all in a single page of code.
So I thought I should use a switch statement(s) rather than a long complicated line of IF ELSE type statements.
Does that sound like a good idea?
Additionally….
If the php code gets pretty long, is it OK to put all this into a single page? Or will the page become slow to load? (Worded another way---If the conditional returns a FALSE, does it skip to the next conditional, or read every line anyway?)
We have a development server here, and we would like to be able to log all mail that is sent out (at the very least, To, From, Subject, and File Name and maybe the line number) because we have multiple people writing scripts. For the most part, any use of a custom function won't be helpful because there's still the issue of pre-made scripts that use mail(), and people who may not know about said function in the first place (and would help us in not having to code this in manually either)
This is on a Windows box with mod_php, so any solution that doesn't require recompiling would be nice (and because those would be lost on upgrades to PHP if I forget to make said changes before hand).
foreach ($dbReq['modules'] as $modName) { if (!extension_loaded($modName)) { $badDb = true; break; } }
Seems pretty simple right? But c'mon, SEVEN lines of code?
Sorry, this won't do. Why should a whole seven lines be used up for something so simple? Really, the simple stuff should be as invisible as possible, right?
In the end, some if statement checks for the value of $badDb, but I renamed $badDb to $x and did this:
while ((list(,$mn) = each($db['modules'])) && !isset($x)) if (!extension_loaded($mn)) $x = 1;
Not only does it do the same thing, but it's just one line of code and it works with E_ALL.