Type: Posts; User:
I'll look into it. Thanks for the tip and the help.
Yes, I believe the page you linked to said that the second parameter was the array to be searched, which would be $losers.
I used "if (!in_array($user_agents, $losers, true))" which I took to mean...
if (!in_array($user_agents, $losers, true))
The website owner wanted a visitor counter, but I didn't want some robots counted so I wanted to check the HTTP_USER_AGENT of those accessing the...
I'm getting this error on my page counter: Warning: Wrong parameter count for in_array() in... on line 14.
Here's the code:
$user_agents = getenv('HTTP_USER_AGENT');
$losers = array(...
I'm glad you were able to get it working. Is there any way to mark this thread resolved if it is resolved?
It depends on how you make your website and pages. If you start getting "headers already sent" error messages then you may want to consider using ob_start and ob_end_flush.
I use this at the top of every page that I'm using sessions on or wanting to carry sessions over on:
and this on the bottom of every page:
Your form does not set $email up as a POST variable that I see.
You can simplify things a bit too, by just writing echo " And include everything you want then use "; when you're done instead of...
The book PHP and MYSQL Second Edition by Larry Ullman has a chapter creating such a program. It's based on PHP 5 and MySQL 4.1. You can probably pick it up a copy for a good price.
I was using codes below to display months and years in a form but with a PHP upgrade it's throwing E_STRICT notice: errors saying I should use the time() function instead. How can I modify these code...
At first I thought it may have been something my hosting company put on, but when I got to looking around I found this same script in each one of my folders (even my htacces protected folders) and...
Can anyone tell me what this script does?
Something went wrong when I tried to edit my last reply.
What I was trying to say is that in my actual script I had an "ORDER BY" clause and I had placed it before the WHERE clause. Simple...
I feel stupid... I had an "ORDER BY" in my actual script and I had it before the where clause. It's working now.
How can I use a decimal number in a search query?
$sql = "SELECT * FROM table WHERE amount=1.00";
$sql = "SELECT * FROM table WHERE amount=.65";
I've tried this:
$sql = "SELECT *...
I wrote my own CMS. I has an admin area where the owner can easily add, edit, delete their information. It's small and fast. It's great because its just code, so I can easily insert it into any...
I was using a different content type. Working now. Thanks
I'm trying to use a span class for the first sentence of a paragraph to make it bold, larger font and different color. It works as it should in Firefox of course, and in IE8 but not in IE9.
Thanks, I'll give it a go. I've seen dozens of websites that told the visitor that their browser must be set to accept cookies, so it shouldn't be a big deal.
When posting your code try and leave out your styling and any information that isn't necessary. For instance, Yours:
<table width="661" height="254" border="0" align="center" cellpadding="3"...
Here's what I'm using on each page:
$page_title = "$page_title";
$user_agent = getenv("HTTP_USER_AGENT");
$ip = getenv("REMOTE_ADDR");
I use three pages with my forms:
The HTML form page.
The error checking and look over everything page.
The information processing page.
When I'm using forms I'll have the HTML form on the...
Check to see if results are returned - if so display information, if not display message.
echo "<table width='500' border='0' cellspacing='0' cellpadding='2'>";
$query = "SELECT * FROM...
My understanding of session is somewhat limited, so the question I'm asking may be silly because the problem I'm having may be what sessions are designed to do. But here goes...
I have a website...
I found that I could achieve what I wanted by using nested loops.