chrometweaks.org

I need help with my iPage.com webpage!?

Click Here To View All Answers...


First off, I need help with my iPage.com webpage!? Many thanks for any answer. 2nd question I got is.. I am trying to restrict access to a category based on the user having to agree to being age 18. Based on some code from another topic similar, I have added to includes/application_top:.

If ($cPath_array[0] == '1') {.

    tep_redirect(tep_href_link(FILENAME_AGEAGREE));.

} else {.

 if ($cPath_array[0] == '1') {.

 if (!tep_session_is_registered('agree') || ($agreed_to_terms != 'yessir')) {.

    tep_redirect(tep_href_link(FILENAME_AGECHECK));.

     }.

  }.

}.

I have created a file called agedisclaimer.php which is referenced above by FILENAME_AGEAGREE. The heart of this file determines what should be set by the file that sets the cookie:.

<input name="Button" type="button" onClick="MM_goToURL('parent','agecheck.php?agree=on');return document.MM_returnValue" value="Agree">.

              <em> </em>.

              <input name="Disagree" type="button" id="Disagree" onClick="MM_goToURL('parent','agecheck.php?disagree=on');return document.MM_returnValue" value="Disagree">.

Last but not least, the file which sets the cookie:.

<?php.

If ($agree == on).

{.

   setcookie ("agree", "yessir", time()+100903600);.

   echo "<meta http-equiv=\"refresh\" content=\"0; URL=http://www.inncasinos.com/index.php?cPath=1\"\\>";.

}else{.

     if ($disagree == on).

      {.

        setcookie ("disagree", "nosir", time()+100903600);.

         echo "<meta http-equiv=\"refresh\" content=\"0; URL=http://www.inncasinos.com\"\\>";.

      }.

}.

If ($HTTP_COOKIE_VARS[agree]).

{.

   echo "<meta http-equiv=\"refresh\" content=\"0; URL=http://www.inncasinos.com/index.php?cPath=1\"\\>";.

}elseif ($HTTP_COOKIE_VARS[disagree]).

{.

       echo "<meta http-equiv=\"refresh\" content=\"0; URL=http://www.inncasinos.com\"\\>";.

}else {.

     include('agedisclaimer.php');.

     }.

?>.

Somewhere in all of this cut and paste crap I have managed to get a few things right, but now get myself stuck in a loop at the agedisclaimer page. Does anyone have any clue how to break out of this and if I have agreed to the terms, push me on the the actual category page?..

Comments (63)

Good question... I dunno what is the answer. I'll do some research and get back to you if I bump into an useful answer. You should email the people at iPage as they probably could assist you..

Comment #1

There is a contribution that should help you out. I have it on my iPage site as an agree before purchase. I forgot what the contrib is called, but a search should turn it up...

Comment #2

Doesnt help me as the redirection is not part of that contrib..

Comment #3

Oh my God....

I hate diseny...

Switch it to barney.com..

Comment #4

Ok, if I was in your place I would make a separate page (that has to do nothing with the shopping Cart (except to retireve the Session Id)... If user goes in the (must agree) site, if the session is stored let em enter else redirect to the agree page....

When the user agrees, redirect to the (must agree) iPage site ...

I would use both of sessions and cookies to track the agreements, and also use the header("Location: http:\\\www.barney.com") method to redirect.

Peace,.

This post has been edited by.

Aziz.

: 14 March 2004, 20:24..

Comment #5

Did you read above aziz? Already did the seperate page thing. The problem is breaking out of the loop...

Comment #6

Okay - I am ready to give up..

I have asked a few people I know and we have tried every combinatiuon we can think of. The last stab we took was:.

<?.

If ($cPath_array[0] == '1') {.

If (tep_session_is_registered('agree') == 'yessir'){.

 tep_redirect(tep_href_link(FILENAME_AGEAGREE));.

} else {.

 tep_redirect(tep_href_link(FILENAME_AGECHECK));.

}.

}.

?>.

That should have worked when placed in the index page - but like everything I have tried thus far - bupkus. If any of the gurus could help me sort this I will gladly give a 100$ gift certificate to my shop when it opens. Hell I'll give ya 2 of them just to get this damn thing to work right..

I do have to make one comment tho: the support here is quite aweful for such a widely used cart. I understand that it is free and that we all want something other then the out of the box cart... I would think tho that with all of the people here who seem to understand this great program that there would be a little more generousity in the sharing of knowledge. I was always under the impression that was the whole point behind this program and this community...

Comment #7

Should this not work???? Anyone???? Holy crap!!!.

<?.

If ($_REQUEST['agree'] == 'on'){.

Tep_setcookie('agree', 'yessir', time()+100903600);.

Echo '<meta http-equiv="refresh" content="0; URL=http://www.inncasinos.com/index.php?cPath=1">';.

} elseif ($_REQUEST['disagree'] == 'on'){.

Tep_setcookie('agree', 'nosir', time()+100903600);.

Echo '<meta http-equiv="refresh" content="0; URL=http://www.inncasinos.com">';.

}.

If (tep_session_is_registered('agree') == 'yessir'){.

Echo '<meta http-equiv="refresh" content="0; URL=http://www.inncasinos.com/index.php?cPath=1">';.

} elseif (tep_session_is_registered('agree') == 'nosir'){.

Echo '<meta http-equiv="refresh" content="0; URL=http://www.inncasinos.com">';.

} else {.

Include('agedisclaimer.php');.

}.

?>..

Comment #8

Kevin,.

Take a deep breath..

I'll try to look at this and contact you tomorrow if no one else replies..

Bob..

Comment #9

Thanx for the offer Bob. Look forward to it...

Comment #10

Well - the cookie is being set but not read is what I have concluded. Even testing it on my other iPage site www.inntelevision shows that the script is wrong - you click agree and the cookie is set - when you return to the iPage site you get the form again when you should get the page you agreed to go to..

I'm speaking on deaf ears of course but just felt like posting this anyway. In the event someone knows how to get past this please feel free to take of my straight jacket and yank me out of my drool puddle...

Comment #11

All finished - this topic can be closed - Thanx Bob!!!!..

Comment #12

I am trying to restrict access to a category based on the user having to agree to being age 18. Based on some code from another topic similar, I have added to includes/application_top:.

If ($cPath_array[0] == '1') {.

    tep_redirect(tep_href_link(FILENAME_AGEAGREE));.

} else {.

 if ($cPath_array[0] == '1') {.

 if (!tep_session_is_registered('agree') || ($agreed_to_terms != 'yessir')) {.

    tep_redirect(tep_href_link(FILENAME_AGECHECK));.

     }.

  }.

}.

I have created a file called agedisclaimer.php which is referenced above by FILENAME_AGEAGREE. The heart of this file determines what should be set by the file that sets the cookie:.

<input name="Button" type="button" onClick="MM_goToURL('parent','agecheck.php?agree=on');return document.MM_returnValue" value="Agree">.

              <em> </em>.

              <input name="Disagree" type="button" id="Disagree" onClick="MM_goToURL('parent','agecheck.php?disagree=on');return document.MM_returnValue" value="Disagree">.

Last but not least, the file which sets the cookie:.

<?php.

If ($agree == on).

{.

   setcookie ("agree", "yessir", time()+100903600);.

   echo "<meta http-equiv=\"refresh\" content=\"0; URL=http://www.inncasinos.com/index.php?cPath=1\"\\>";.

}else{.

     if ($disagree == on).

      {.

        setcookie ("disagree", "nosir", time()+100903600);.

         echo "<meta http-equiv=\"refresh\" content=\"0; URL=http://www.inncasinos.com\"\\>";.

      }.

}.

If ($HTTP_COOKIE_VARS[agree]).

{.

   echo "<meta http-equiv=\"refresh\" content=\"0; URL=http://www.inncasinos.com/index.php?cPath=1\"\\>";.

}elseif ($HTTP_COOKIE_VARS[disagree]).

{.

       echo "<meta http-equiv=\"refresh\" content=\"0; URL=http://www.inncasinos.com\"\\>";.

}else {.

     include('agedisclaimer.php');.

     }.

?>.

Somewhere in all of this cut and paste crap I have managed to get a few things right, but now get myself stuck in a loop at the agedisclaimer page. Does anyone have any clue how to break out of this and if I have agreed to the terms, push me on the the actual category page?..

Comment #13

BTW - I have tested the basic cookie code at.

This Webpage.

..

It looks for the cookie and if not found calls the correct form page. Once clicked, the proper re-direct does occur. So what am I saying this for??.

Well what I am hoping then is that some code guru can help me over the loop I have going when I try and implement this in osC..

This post has been edited by.

Virtual1.

: 13 March 2004, 18:21..

Comment #14


This question was taken from a support group/message board and re-posted here so others can learn from it.