Page 1 of 1

Code Problem - Urgent Help Needed!!!!

Posted: Sat Aug 10, 2002 8:23 am
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

Posted: Sat Aug 10, 2002 10:28 am
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.

LOL

Posted: Sun Aug 11, 2002 3:42 am
by Takuma
I do that thing all the time LOL I get confused