I have a PHP form that allows end users to request a sample of the
products we sell. Unfortunately, a person/people have found it and
are sending in bad requests. We sell only within the US, and so I've
set up the form so that they must choose one of the 50 States. But we
keep getting r
Hi all,
I was wondering if someone might know about a problem I'm having on
my server. It appears that I've been infected by a rogue PHP
script(?). Something has gone through my server and placed .htaccess
files in every directory that didn't have one with contents that look
like this:
On Apr 4, 2009, at 6:51 PM, TG wrote:
Anyway, just some thoughts. Good luck!
Thanks to TG, Bastien, and Marc. I appreciate the input.
Regards,
Frank
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
This may be more of a MySQL question than PHP, but I'm hoping someone
can point me in the right direction. I have working code (below) that
pulls data from a particular category in our db. I'd like to be able
to pull data from multiple categories in the same db and place them on
the same
On Jul 28, 2009, at 12:48 PM, Jim Lucas wrote:
';
echo '';
foreach ( $cats AS $cat ) {
echo ''.htmlspecialchars($cat).'';
}
echo '';
foreach ( $cats AS $cat ) {
echo '';
$cat = mysql_real_escape_string($cat, $db);
$SQL = "SELECT itemid,description,unitprice
On Jul 28, 2009, at 12:48 PM, Jim Lucas wrote:
';
echo '';
foreach ( $cats AS $cat ) {
echo ''.htmlspecialchars($cat).'';
}
echo '';
foreach ( $cats AS $cat ) {
echo '';
$cat = mysql_real_escape_string($cat, $db);
$SQL = "SELECT itemid,description,unitprice
On Jul 28, 2009, at 4:38 PM, Jim Lucas wrote:
I saw your other email before sending. The problem with the way you
show you want it there is that each result set would have to be the
same
size. I'm going to assume that they won't be...
Well, they SHOULD be but you never know. Thanks for
Is there a more efficient way to write the following?
itemid='ABC1'",$db);
printf("List: %s\n", money_format('$%i',
mysql_result($result,0,"priceList"))); ?>
I have many products per page and this code pulls the list price and
formats it. It works fine, but I'd like to know if I c
On Aug 3, 2009, at 7:19 AM, Miller, Terion wrote:
Not sure why none of these are working for me since you have them
tested against your tableI get this error...
Hopefully I'm not speaking out of turn here, but did you by any
chance copy and paste that code from an e-mail? If so, ther
I'd like to revisit this one last time. Below is the revised code
I'm using, but I don't like having individual 'Add To Cart' buttons
for each item. I've tried to find a way to have only one that resides
outside the nested tables for all items, but without luck. It would
need to send ev
Is what I'm looking to do not possible in PHP? I've come close with
a JavaScript version, but I'd rather not rely on everyone having JS
turned on. Or am I stuck having to use JS?
Thanks again,
Frank
I'd like to revisit this one last time. Below is the revised code
I'm using, but I do
On Aug 4, 2009, at 9:43 AM, Jerry Wilborn wrote:
Keep in mind that you can use name=var[] value=value1, name=var[]
value=value2 and php will create an array as $_REQUEST['var'] with
each of your values. The keys are numbered and don't count on what
order they'll come through.
Thanks for
Sorry... I'm using GET. I have used the code you supplied below, but
as I mentioned, it gets sent for every itemid in the table. I needs
to be sent only once, and right after the action. That's where I'm
stumped.
Frank
On Aug 4, 2009, at 11:56 AM, Jerry Wilborn wrote:
If the form meth
On Aug 4, 2009, at 12:33 PM, Ben Dunlap wrote:
I don't follow what you mean by "it gets sent for every itemid" --
can you post
an example of the query string that's being generated?
Well, do I feel stupid. I thought I had moved it to the correct spot
but I hadn't. When value="viewcart.
I've run up against something else here that I can't find an answer
for. This line of the script:
$cats = array('01100-01200-01300-06403' => 'Starter Units',
'01100-02201-01300-06403' => 'Add-On Units', '01100-99222-11341-18451'
=> 'Extra Shelves');
is supposed to pull all items from ea
Well, it took me all evening to figure it out, but I did. The SQL
statement needed to be changed to
WHERE categories LIKE '%$cat%'
and now it works. I had found an old book on my shelf called "MySQL
and Perl for the Web" and found an example in there that pointed me in
the right direction
Has anyone read this book by Larry Ullman yet? If so, what do you
think about it? I'm looking for a well-rounded book that covers PHP
for e-commerce websites and from what little I've been able to find
online, it looks pretty good. Or would you recommend another book?
I know that no bo
On Aug 11, 2009, at 12:13 AM, hessi...@hessiess.com wrote:
Do *NOT* get into the habit of outputting your HTML using echo or
print
statements, it becomes unmaintainable very quickly, use a templating
language, ether with a framework(recomended) or standalone.
This sounds interesting. Coul
I've searched high and low for an answer to this. Hopefully someone
here might know. Can PHP be used under a CGI? I tried to put the
following code on one of my perl shopping cart pages but it doesn't
work:
";
for ($year = date("Y") ; $year <= date("Y") + 8 ; $year++) {
echo "$y
On Aug 18, 2009, at 7:13 PM, Shawn McKenzie wrote:
I assumed that the problem was that he
knew PHP and he had downloaded a Perl cart and didn't know Perl.
That's exactly the case. I have been running my business on a Perl
cart for the last 5+ years, and I can't switch to a PHP cart just
Hi Tedd,
In your .htacess file add this:
# handler for phpsuexec. -- makes following prefixes considered for
php
SetHandler application/x-httpd-php
Thanks for the code. I placed it in the .htaccess file for the
output templates, but unfortunately it didn't work. It just prints
ou
Hi all,
I'm using this code to display the current time for our location on
our website:
$theMinute = $theTimeIs['minutes']; // make minutes
under 10 show two digits
$theSecond = $theTimeIs['seconds'];
if($theHour > 12){
$theHour = $theHour - 1
On Aug 20, 2009, at 2:38 PM, Ashley Sheridan wrote:
What's wrong with using the date() function? You can have it output
any
sort of format you wish. So, getting a 2 digit time in
hours:minutes:seconds you would put:
date("H:i:s");
Thanks, Ash. I had tried that before but I couldn't find
On Aug 20, 2009, at 2:34 PM, Jonathan Tapicer wrote:
You can use sprintf or str_pad to fill in with zeros, with sprintf
you can do this:
echo sprintf('%02d', 5);
Thanks, Jonathan! I learned two new functions today! Both work
great but I think I like sprintf for this application better
I'd like to get everyone's opinion on a good PHP shopping cart. We
need something that will handle a lot of similar items and can be
geared for an industrial site selling products from different
manufacturers. It needs to be PCI compliant and able to handle at
least 5 sub-category levels
The only e-commerce site I've worked on was based on OSCommerce. It's
pretty good, easy to integrate new functionality into, and not too
much
trouble to style up to look the way you want with CSS.
Thanks, Ash. I downloaded CRE Loaded, which is an off-shoot of
osCommerce, and the latest
On Aug 26, 2009, at 9:28 AM, Paul M Foster wrote:
and having a great marriage to a woman I can spend hours talking about
nothing to.
I'm jealous. Does she have a sister who's not spoken for? =;)
Frank
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://
Is there is a way to search only for the alphanumeric content of
field in a db? I have an itemID field that contains item #'s that
include dashes, forward slashes, etc, and I want people to be able to
search for an item # even if they don't enter the punctuation exactly.
Here's an exampl
Thanks to everyone who has responded. After reading everyone's
response, I think I have a very simple way to solve my "problem".
Using my original example, if someone wants to find item #
4D-2448-7PS, no matter what they type in, I'll take the input, strip
out all non-alphanumeric charac
In my readings, I've run across examples showing include files being
called from within the tags, and other examples showing
them called within . I've always put them in the header
section myself, but I was wondering if one is better than the other,
or is it just personal preference?
F
On Sep 4, 2009, at 1:05 PM, Bob McConnell wrote:
Depends on what you are including. The only tags that can be inside
the
head are , , ,
Hi all,
I could use some help. I've scoured both the MySQL and PHP sites
that I know of and can't find an answer to this.
I have a price field that sometimes contains entries like this:
250,(min)
5.32
How can I pull just the price ($5.32 in this example) from this field
to disp
On Sep 24, 2009, at 12:15 PM, Jay Blanchard wrote:
substr will work from right to left.
If your data is in a variable do this;
Thanks, Jay. That does the job.
Frank
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I think I've solved a problem that I had posted back in September.
Here's a recap:
==
I need to grab a dollar amount from a text field in a MySQL db that
can contain more information than just the price. Here are 4 examples
of what could be in that field:
48,(min)
Hi Jim,
$parts = explode(PHP_EOL, $item['unitprice']);
$price = '$'.(( count($parts) > 1 ) ? $parts[0] :
$parts[(count($parts)-1)]);
Thanks for the code! After reading up on PHP_EOL and explode, I now
understand what you've done. However, can you tell me why you like
this better? Is
Jim,
$parts = explode(PHP_EOL, $item['unitprice']);
$price = '$'.(( count($parts) > 1 ) ? $parts[0] :
$parts[(count($parts)-1)]);
For some reason, I couldn't get explode to work with PHP_EOL.
$parts[0] would return the entire field, so apparently it wasn't
"exploding". So I tried exp
On Nov 13, 2009, at 6:34 PM, Jim Lucas wrote:
You basic problem with the PHP_EOL is that when echo'ed out, it
represents a \n character.
The value you are working with might be \n\r or just \r
I read the links you sent, plus some others. It took me awhile, but
I get it now. If the "ret
On Jan 4, 2011, at 5:27 AM, Steve Staples wrote:
> I now use Komodo (the free version) on my ubuntu workstation, and I love
> it... I dont know how I managed before.
I use Komodo Edit on OS X and I love it as well, except for the compare
files feature. It's the worst one I've ever used
On Apr 18, 2012, at 1:30 PM, Henry Martinez wrote:
> I've been having a lot of fun with Beginning PHP 5.3 by Matt Doyle. Covers
> basics nicely...
>
> Also, the code samples and explanations are top notch, and you come to really
> understand what it is you're doing..
+1
Marc
--
PHP Ge
I'm using a script called BlackHole that uses PHP and a "hidden"
directory to catch bad bots and block them by their IP address from the site
[http://perishablepress.com/blackhole-bad-bots/]. It's working very well, but
I'd like to expand on the idea.
When looking at our access
I'd like to make a suggestion for a change, or possibly an addition, to the PHP
language.
I'm learning PHP and have been very excited with what it can do in relation to
HTML. But when I got to the part about arrays, I was disappointed to see that
they are designated with a $ the same as other
Thanks for all the responses to my suggestion. I realize this would be a major
change, so that's why I also mentioned it as an addition to the language.
I'm sure it's just what you're used to, but still being new to all this, it
just makes sense (to me anyway) to have different symbols for diff
On Feb 11, 2011, at 2:08 AM, Mattias Geniar wrote:
> Have a look at the library called 'pChart':
> http://pchart.sourceforge.net/
> While it's a bit old...
Actually, it's been updated to v2.1 now. It looks pretty nice.
http://www.pchart.net/
Marc
Jim,
> Actually - I can't seem to find a mysql newsgroup anywhere. The ones that
> come up in google search are all dead and buried.
I found a mailing list that might work for you:
To subscribe to the list, send an empty message to
Marc
--
PHP General Mailing List (http://www.php
On Apr 7, 2011, at 7:19 AM, Marc Guay wrote:
> session_start(); // Genesis
>
> // do stuff
>
> session_destroy(); // Revelation
Now THAT'S clever! =:)
I'm half way though "Beginning PHP 5.3" by Matt Doyle and I like it a
lot. Very readable, and up-to-date.
Marc
--
PHP Gener
On May 18, 2011, at 3:06 PM, tedd wrote:
> You know, if you sat down with me and saw how my IDE handles braces, I think
> you might see the reason why I code like I do.
Tedd,
I like the demo. Thanks for posting it.
From another post of yours, I take it that you're a Mac guy.
On Mar 15, 2012, at 11:35 AM, Daniel Brown wrote:
> On Thu, Mar 15, 2012 at 14:31, Stuart Dallas wrote:
>>
>> The @ prefix is banned from all code I go anywhere near - it's evil!
>
>For the most part, I agree with you,
Hmm... I use it on my web pages (unless I'm testing) so that i
On Mar 15, 2012, at 11:52 AM, Stuart Dallas wrote:
> Change your php.ini settings to log to a file and set display_errors to off.
Sometimes when you ask a stupid question you end up getting a brilliant
answer. I had no idea about any of this until I received your response, which
got me
48 matches
Mail list logo