Code Problem - Urgent Help Needed!!!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
eokorie
Forum Newbie
Posts: 2
Joined: Sat Aug 10, 2002 8:23 am

Code Problem - Urgent Help Needed!!!!

Post by eokorie »

Can anybody tell me what is wrong with this code? I have tried to figure out what is wron with it but still no chance with it at all.
------------------------------------------------------------------------------------------------------------------------------------------------------------------

// Grafikkaos.co.uk
// *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
// create the list of parameters which should not be maintained
$Item_keepURL="";
$Item_keepForm="";
$Item_keepBoth="";
$Item_keepNone="";

$Item_paramName = "";
$Item_Choice = "";
$Item_Choice_Next = "";
$Item_removeList = "";

$Item_removeList="&index=";
if (($Item_paramName!=""))
{

$Item_removeList=$Item_removeList."&".$Item_paramName."=";
}

// add the URL parameters to the Item_keepURL string
foreach ($HTTP_GET_VARS as $Item_Choice)
{

} echo "&".$Item_Choice."=";
if (((strpos(1,$Item_removeList,$Item_Choice_Next,1) ? strpos(1,$Item_removeList,$Item_Choice_Next,1) + 1 : 0)==0)) // Help me with code on this line -------------
{
$Item_keepURL=$Item_keepURL.$Item_Choice_Next.rawurlencode($HTTP_GET_VARS[$Item_Choice]); // Help me with code on this line -------------

}

--------------------

Every time I run this code, it says:

&127.0.0.1=<br />
<b>Warning</b>: Wrong parameter count for strpos() in <b>D:\Documents and Settings\Emmanuel Okorie\My Documents\related_page_dwmx.php</b> on line <b>26</b><br />
and I get Undefined index 127.0.0.1


Can anyone out there help?


Thanks

Emmanuel Okorie
User avatar
llimllib
Moderator
Posts: 466
Joined: Mon Jul 01, 2002 2:19 pm
Location: Baltimore, MD

Post by llimllib »

Emmanuel, if you ever want a response from a bulletin board or email list, you should not ask for urgent help. If you would like, many of us are available for very reasonable hourly rates. Anyway, I'll help you by putting a quotation from the manual here:
int strpos ( string haystack, string needle [, int offset])
and a quote from your code:
strpos(1,$Item_removeList,$Item_Choice_Next,1)
See the difference? the error message tells you exactly what's happening - you're sending four arguments to a function that only takes three.
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

LOL

Post by Takuma »

I do that thing all the time LOL I get confused
Post Reply