PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old August 11th, 2002, 11:46 AM
eokorie eokorie is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 7 eokorie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Help me with this code!!!

Can anyone have a look at this code and tell me if it looks correct. I have been working on this for a long time and i still can't find what it wrong with it. everything seems to working well but when I run / debug the code, i get the errors:

Line 33 Undefined index: 127.0.0.1
Line 45 Undefined index: 127.0.0.1


Can anyone tell me where I have gone wrong to get such an error?

Thanks,

Emmanuel Okorie




<?php
// 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) ? strpos(1, $Item_removeList,$Item_Choice_Next) + 1 : 0)==0))
{
$Item_keepURL=$Item_keepURL.$Item_Choice_Next.rawu rlencode($HTTP_GET_VARS[$Item_Choice]);
}

// add the Form variables to the Item_keepForm string
foreach ($HTTP_POST_VARS as $Item_Choice)
{

} echo "&".$Item_Choice."=";

if (((strpos(1,$Item_removeList,$Item_Choice_Next) ? strpos(1, $Item_removeList,$Item_Choice_Next) + 1 : 0)==0))
{

$Item_keepForm = $Item_keepForm.$Item_Choice_Next.rawurlencode($HTT P_POST_VARS[$Item_Choice]);
}


// create the Form + URL string and remove the intial '&' from each of the strings
$Item_keepBoth=$Item_keepURL.$Item_keepForm;

if (($Item_keepBoth!=""))
{

$Item_keepBoth=substr($Item_keepBoth,strlen($Item_ keepBoth)-(strlen($Item_keepBoth)-1));
}

if (($Item_keepURL!=""))
{

$Item_keepURL=substr($Item_keepURL,strlen($Item_ke epURL)-(strlen($Item_keepURL)-1));
}

if (($Item_keepForm!=""))
{

$Item_keepForm=substr($Item_keepForm,strlen($Item_ keepForm)-(strlen($Item_keepForm)-1));
}

// a utility function used for adding additional parameters to these strings
function MM_joinChar($firstItem)
{
// global extract(GLOBALS);


if (($firstItem!=""))
{

$function_ret="&";
}
else
{

$function_ret="";
}

return $function_ret;
}

?>

Reply With Quote
  #2  
Old August 11th, 2002, 02:12 PM
Taoism Taoism is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Winnipeg, MB, Canada
Posts: 81 Taoism User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 sec
Reputation Power: 2
RE: Help me with this code!!!

Look at the foreach loops for starters, perhaps you wanted the line below them to actually be inside them? :
php Code:
Original - php Code
  1.  
  2. <?php
  3. // Grafikkaos.co.uk
  4.  
  5.  
  6. // *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
  7. // create the list of parameters which should not be maintained
  8. $Item_keepURL="";
  9. $Item_keepForm="";
  10. $Item_keepBoth="";
  11. $Item_keepNone="";
  12.  
  13. $Item_paramName="";
  14. $Item_Choice="";
  15. $Item_Choice_Next="";
  16. $Item_removeList="";
  17.  
  18.  
  19. $Item_removeList="&index=";
  20.  
  21. if(($Item_paramName!="")){
  22.   $Item_removeList=$Item_removeList."&".$Item_paramName."=";
  23. }
  24.  
  25. // add the URL parameters to the Item_keepURL string
  26. foreach ($HTTP_GET_VARS as $Item_Choice){
  27.   //*** THERE IS NOTHING IN THIS FOR LOOP ***
  28. }
  29. echo "&" .$Item_Choice. "=";
  30.  
  31. if(((strpos(1,$Item_removeList,$Item_Choice_Next)strpos(1,$Item_removeList,$Item_Choice_Next)+1:0)=  =0)){
  32.   $Item_keepURL=$Item_keepURL.$Item_Choice_Next.rawu  rlencode($HTTP_GET_VARS[$Item_Choice]);
  33. }
  34.  
  35. // add the Form variables to the Item_keepForm string
  36. foreach ($HTTP_POST_VARS as $Item_Choice){
  37.   //*** THERE IS NOTHING IN THIS FOR LOOP ***
  38. }
  39. echo "&".$Item_Choice."=";
  40.  
  41. if(((strpos(1,$Item_removeList,$Item_Choice_Next)strpos(1,$Item_removeList,$Item_Choice_Next)+1:0)=  =0)){
  42.   $Item_keepForm = $Item_keepForm.$Item_Choice_Next.rawurlencode($HTT  P_POST_VARS[$Item_Choice]);
  43. }
  44.  
  45.  
  46. // create the Form + URL string and remove the intial '&' from each of the strings
  47. $Item_keepBoth=$Item_keepURL.$Item_keepForm;
  48.  
  49. if (($Item_keepBoth!="")){
  50.   $Item_keepBoth=substr($Item_keepBoth,strlen($Item_  keepBoth)-(strlen($Item_keepBoth)-1));
  51. }
  52.  
  53. if (($Item_keepURL!="")){
  54.   $Item_keepURL=substr($Item_keepURL,strlen($Item_ke  epURL)-(strlen($Item_keepURL)-1));
  55. }
  56.  
  57. if (($Item_keepForm!="")){
  58.   $Item_keepForm=substr($Item_keepForm,strlen($Item_  keepForm)-(strlen($Item_keepForm)-1));
  59. }
  60.  
  61. // a utility function used for adding additional parameters to these strings
  62. function MM_joinChar($firstItem){
  63.   // global extract(GLOBALS);
  64.   if(($firstItem!="")){
  65.     $function_ret="&";
  66.   }else{
  67.     $function_ret="";
  68.   }
  69.   return $function_ret;
  70. }
  71.  
  72. ?> 


Cheers,
Keith.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Help me with this code!!!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway