473,322 Members | 1,307 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

trying to port a CGI script to PHP

I'm trying to port an old CGI script to PHP but am having some problems in one area.


Expand|Select|Wrap|Line Numbers
  1. # List of IP addresses to ignore, add your own IP to the list
  2. $ignoreme = array("127.0.0.1, 127.0.0.2");
  3.  
  4. foreach($ignoreme){
  5. echo "ignored";
  6. }
This is just a snipit from the script that shows users online and counts the number of hits on the web page. I can't seem to get the foreach to test against the array it should print ignored 2 times.
May 16 '06 #1
2 1421
Banfa
9,065 Expert Mod 8TB
You have missed 2 " inserted below

[php]# List of IP addresses to ignore, add your own IP to the list
$ignoreme = array("127.0.0.1", "127.0.0.2");

foreach($ignoreme){
echo "ignored";
}[/php]
May 16 '06 #2
You have missed 2 " inserted below

[php]# List of IP addresses to ignore, add your own IP to the list
$ignoreme = array("127.0.0.1", "127.0.0.2");

foreach($ignoreme){
echo "ignored";
}[/php]
Looks like you missed one also. I want and looked over the foreach statement and had to change that also to this before it would work properly:


Expand|Select|Wrap|Line Numbers
  1. foreach($ignoreme as $value){
  2. echo $value."<br>";
  3. }
May 17 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Matt | last post by:
I'm trying to get the HTML data off of a webpage. Let's say for the sake of argument it's the python homepage. I've googled around and found some examples that people said worked. Here's what...
13
by: Adam | last post by:
Hi! I'm trying to write a small application for an online gaming site (flight sims), where people can add their local server to a list. Basically, I just need to be able to loop/ping each...
0
by: deepak | last post by:
Hi All, i m develpoing a .net Window application which has 4 texboxes(tbxURLmfor URL in URL Frame,tbxAddress for address in Proxy server frame,tbxPort for port in proxy server...
1
by: BF | last post by:
Hi, I want the change the SQL listen port of a named 2005 sql instance. Is there a way I can run an sql query against the named instance which gives me back which registry setting I need to...
6
by: Mitesh | last post by:
How can I programattically retrieve MySQL server's port value through PHP?
2
by: rick11 | last post by:
I need know when a drive is a USB drive, what USB port is it in? For the system I am doing this on, I do not have to worry about hubs plugged into hubs (into hubs...). It's just the motherboard...
1
by: danfolkes | last post by:
Hey Everyone, I am trying to send repeated messages from a "Node" to a "Server". It works the first time I send the from the Node to Server, but after that it either errors, or does not do...
5
by: walterbyrd | last post by:
I don't know much php either, but running a php app seems straight forward enough. Python seems to always use some sort of development environment vs production environment scheme. For...
7
by: jeddiki | last post by:
Hi, As I am in Turkey at present, I can not see vidoes on youtube. So I have tried a few proxies but keep finding them slow or not working. So I have installed myphpProxy on my server under...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.