473,396 Members | 1,992 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,396 software developers and data experts.

Is there a php script to accept terms & conditions

35
hi,

would anyone know if there is a php script to Accept the Terms & Conditions. The customer must check the Terms & Conditions box before he/she is able to go to the next page.
Not really sure what this script would come under

thanks
Nov 27 '07 #1
13 21208
Lumpy
69
hi,

would anyone know if there is a php script to Accept the Terms & Conditions. The customer must check the Terms & Conditions box before he/she is able to go to the next page.
Not really sure what this script would come under

thanks

If your looking just to download the script from someone else than I would type "php script to Accept the Terms & Conditions" into Google and go from there. Plenty of sites like hotscripts.com come up and you can search through what they have and go from there.
Nov 27 '07 #2
pbmods
5,821 Expert 4TB
Heya, Camphor.

On the page with the terms and conditions, add a checkbox:
Expand|Select|Wrap|Line Numbers
  1. <form method="post" action="..." >
  2.     .
  3.     .
  4.     .
  5.     <input type="checkbox" name="accept" /> Accept
  6.  
On the page that processes the form:
Expand|Select|Wrap|Line Numbers
  1. if( isset($_POST['accept']) )
  2. {
  3.     // User accepted terms & conditions.  Go to next page.
  4. }
  5. else
  6. {
  7.     // User did not accept.  Go back.
  8. }
  9.  
Nov 27 '07 #3
vladi
2
Try this
mixing with javascripting under 'echo' helping...
Expand|Select|Wrap|Line Numbers
  1. <? php code here...
  2. echo "head<script>
  3.  
  4.  
  5. var checkobj
  6.  
  7. function agreesubmit(el){
  8. checkobj=el
  9. if (document.all||document.getElementById){
  10. for (i=0;i<checkobj.form.length;i++){  //hunt down submit button
  11. var tempobj=checkobj.form.elements[i]
  12. if(tempobj.type.toLowerCase()=="submit")
  13. tempobj.disabled=!checkobj.checked
  14. }
  15. }
  16. }
  17.  
  18. function defaultagree(el){
  19. if (!document.all&&!document.getElementById){
  20. if (window.checkobj&&checkobj.checked)
  21. return true
  22. else{
  23. alert("Please read/accept terms to submit form")
  24. return false
  25. }
  26. }
  27. }
  28.  
  29. </script>head
  30. body<form name="agreeform" onSubmit="return defaultagree(this)">
  31. Rest of your form here<br>
  32. <input name="agreecheck" type="checkbox" onClick="agreesubmit(this)"><b>I agree to the above terms</b><br>
  33. <input type="Submit" value="Submit!" disabled>
  34. </form>
  35.  
  36. <script>
  37. //change two names below to your form's names
  38. document.forms.agreeform.agreecheck.checked=false
  39. </script>
  40.  
  41. <p align="center"><font face="Arial" size="-2">Free DHTML scripts provided by<br>
  42. <a href="http://www.thescripts.com">You sign!</a></font></p>body";
  43. ?>
before any["] put this [\] will be look-> echo "<head> \"text\" and etc. but not first and last - did you know...!!!
thanks
you is now free...
Nov 28 '07 #4
camphor
35
thank you all for your reply, will try the scripts out
Nov 28 '07 #5
camphor
35
Heya, Camphor.

On the page with the terms and conditions, add a checkbox:
Expand|Select|Wrap|Line Numbers
  1. <form method="post" action="..." >
  2.     .
  3.     .
  4.     .
  5.     <input type="checkbox" name="accept" /> Accept
  6.  
On the page that processes the form:
Expand|Select|Wrap|Line Numbers
  1. if( isset($_POST['accept']) )
  2. {
  3.     // User accepted terms & conditions.  Go to next page.
  4. }
  5. else
  6. {
  7.     // User did not accept.  Go back.
  8. }
  9.  
Hi pbmods,

I tried the code out but it doesn't seem to work and I don't know why, I am a newbie in php, this is what I did
Expand|Select|Wrap|Line Numbers
  1. <?php 
  2.  
  3.       if( isset($_POST['accept']) )
  4.  
  5.       {
  6.  
  7.           // User accepted terms & conditions.  Go to next page.
  8.  
  9.       }
  10.  
  11.       else
  12.  
  13.       {
  14.  
  15.           // User did not accept.  Go back.
  16.  
  17.       }
  18. ?>
  19. <form method="post" action="">
  20.  
  21. <p class="booking"><input type="checkbox" id="cust_agree" name="accept" />&nbsp;I accept the <a href="terms.php">Terms and Conditions</a></p>    
  22.  
  23. <p>If you wish to place an order, please accept the <a href="terms.php">Terms and Conditions </a>by checking<br />
  24.   the box. We reserve the right to refuse any order at our sole discretion and will refund<br /> the fee</p>
  25.  
This is what I want to happen, the customer clicks on a' Package' and before the customer can go to the cart page they must accept the terms and conditions.
This is the link to the page http://www.photorestorationexpert.co.uk/order/index.php
thanks
Dec 12 '07 #6
pbmods
5,821 Expert 4TB
Heya, camphor.

In your case, you'll probably want to do something like this:

Expand|Select|Wrap|Line Numbers
  1. if( isset($_POST['accept']) )
  2.       {
  3.  
  4.           // User accepted terms & conditions.  Go to next page.
  5.           header('Location: cart.php'); // (or whatever the cart page is called)
  6.       }
  7.       else
  8.       {
  9.  
  10.           // User did not accept.  Go back.
  11.           echo '<div>You must agree to the terms and conditions to continue.'</div>
  12.       }
  13.  
Dec 14 '07 #7
camphor
35
Heya, camphor.

In your case, you'll probably want to do something like this:

Expand|Select|Wrap|Line Numbers
  1. if( isset($_POST['accept']) )
  2.       {
  3.  
  4.           // User accepted terms & conditions.  Go to next page.
  5.           header('Location: cart.php'); // (or whatever the cart page is called)
  6.       }
  7.       else
  8.       {
  9.  
  10.           // User did not accept.  Go back.
  11.           echo '<div>You must agree to the terms and conditions to continue.'</div>
  12.       }
  13.  
pbmods,

I used the code and got this error message instead:
Parse error: syntax error, unexpected '<' in /home/photores/public_html/order/index.php on line 124

this is line 124
Expand|Select|Wrap|Line Numbers
  1. <?php 
  2.       if( isset($_POST['accept']) )
  3.             {   
  4.           // User accepted terms & conditions.  Go to next page.
  5.           header('Location: cart.php'); // (or whatever the cart page is called)
  6.             }
  7.             else
  8.             {
  9.           // User did not accept.  Go back.
  10.  (line 124) echo <div>'You must agree to the terms and conditions to continue.'</div>
  11.             }
  12. ?>
  13. <form method="post" action="">
  14.  
  15. <p class="booking"><input type="checkbox" id="cust_agree" name="accept" />&nbsp;I accept the <a href="terms.php">Terms and Conditions</a></p>    
  16.  
I tried fixing it but wasn't really sure what I was doing

thanks
Dec 21 '07 #8
Markus
6,050 Expert 4TB
The single qoutes - line 124 - need to be before the first <DIV> and after the last <DIV>.

Good day.

:)
Dec 21 '07 #9
camphor
35
The single qoutes - line 124 - need to be before the first <DIV> and after the last <DIV>.

Good day.

:)
markusn00b,

thanks for that.

This is what I want to happen, the customer clicks on a' Package' and before the customer can go to the cart page they must first accept the terms and conditions.
This is the link to the page http://www.photorestorationexpert.co.uk/order/index.php
I tried the code that pbmods gave me but it still goes to the cart page without the customer accepting the terms and conditions first, which I want to happen
thanks
Dec 24 '07 #10
Markus
6,050 Expert 4TB
http://www.photorestorationexpert.co.uk/order/index.php

Is that ^^^^ the page in question?

And also, do you want to check that the box has been checked when the 'click to order' button has been pressed?

merry christmas
:)
Dec 24 '07 #11
camphor
35
http://www.photorestorationexpert.co.uk/order/index.php

Is that ^^^^ the page in question?

And also, do you want to check that the box has been checked when the 'click to order' button has been pressed?

merry christmas
:)
That is the page in question and I also want to check that the box (terms & conditions) has been checked when the 'click to order' button has been pressed?
In other words, yes to the above 2 questions
happy new year :-)
Jan 2 '08 #12
Markus
6,050 Expert 4TB
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. function checkTerms(){
  3.     var checkBox = document.termsAndConditions.accept;
  4.     if(!checkBox.checked){
  5.         alert("You must accept our terms and conditions");
  6.         window.location = "http://www.photorestorationexpert.co.uk/order/index.php#termsAndConditions";
  7.         return false;
  8.     } else {
  9.         return true;
  10.     }
  11. }
  12. </script>
  13.  
First we assign the checkBox variable to the checkbox in the form.
Then we check (through onclick - coming later) whether the if statement returns true or false; if it returns false, we alert them and scroll the page down to the terms and conditions*, then we return false - so the href="" doesnt execute.
If the if statamen returns true; the checkbox was checked so carry on.
[code=html]
<form id="termsAndConditions" name="termsAndConditions">
<input type="checkbox" name="accept" />
</form>
<a href="order.html..." onclick="checkTerms()">Click here to order</a>
[/html]
The html.. you'll have to adapt this to your code.

*To have the page scroll down to the terms and conditions you'll have to assign an ID to it. Then you can pass that id into the url and it will automatically scroll down to that section.

Hope this helps :)
Jan 2 '08 #13
camphor
35
hi markusn00b,

I am finding this very frustrating as the php/html bit is not working when I try to test the order page, I have very little knowledge of javascript but I understand your explanation, for the php/html code, would this be correct
Expand|Select|Wrap|Line Numbers
  1.  
  2. Package 4&nbsp; £30
  3. <div id="service1">
  4.     <ul>
  5.     <li>Removal of scratches from face, hand or other complex areas</li>
  6.     <li>Teeth whitening</li>
  7.     <li>Merging two or more photos together</li>
  8.     <li>Color correction of large faded areas</li>
  9.     <li>Repair of tears</li>
  10.     <li>Repair of creases</li>
  11.     </ul></div>
  12. <a href='<?php ProductBuyLink(11); ?>' onclick="checkTerms()"><img src="../images/click-toorder.png" class="clickToOrderBtn" width="80" height="15" border="0" alt="order button" /></a></div>
  13.  
CSS

.clickToOrderBtn {
margin-left:85%;
}

#service1 {
margin:0;
font-size:1.1em;
}

#service1 ul {
font-size:1.0em;
font-family:"Century Gothic";
}

#service1 li {
list-style-type:disc;
margin-left:5%;
font-size:1.0em;
}


I am using php as the shopping cart I am using uses php. I am using an image for the click here to order, so would the bold bit be correct

thanks once again and your help is much appreciated
Jan 10 '08 #14

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

Similar topics

17
by: orekinbck | last post by:
Hi There Say I want to check if object1.Property1 is equal to a value, but object1 could be null. At the moment I have code like this: if (object1 != null) { if (object1.Property ==...
10
by: Immortalist | last post by:
Various aquisition devices that guide learning along particular pathways towards human biases. And as E.O. Wilson might say mental development appears to be genetically constrained. (1) Language...
6
by: Rob | last post by:
Hi all, I would like to have a textarea control on my web page that is complete with terms and conditions, in addition, I would like a radio button beneath this to indicate the acceptance of...
2
by: arnuld | last post by:
on page 29, section 1.9 Character Arrays, i see an example: /* getline: read a line into s, return length */ int getline(char s,int lim) { int c, i; for (i=0; i < lim-1 &&...
2
by: whitey | last post by:
Can anybody supply me with a script the does what is in the title above please? I have tried so many different methods! here is what im currently trying to get to work SIGN IN <!doctype...
5
by: camphor | last post by:
hi, I have found an upload script in hotscripts and have implemented it into the website, I followed the installation steps to 'give write permissions to php on the upload folder (which is...
3
by: aRTx | last post by:
I have try a couple of time but does not work for me My files everytime are sortet by NAME. I want to Sort my files by Date-desc. Can anyone help me to do it? The Script <? /* ORIGJINALI
82
by: happyse27 | last post by:
Hi All, I modified the user registration script, but not sure how to make it check for each variable in terms of preventing junk registration and invalid characters? Two codes below : a)...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.