By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,971 Members | 1,191 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,971 IT Pros & Developers. It's quick & easy.

Help: Can you make this .php less than 1 month??

P: n/a
Hi. Can somebody PLEASE help. Here is a .php script. Right now, the
minimum amount of time (i.e. duration) allowed is 1 month. However, I
want to be able to reduce the minimum amount of time to 2 days (i.e.
48 hours).

Can somebody PLEASE PLEASE tell me what I need to change in this file
to do this? Here is a copy - thanks enormously in advance:

<html>
<head>
<title>Admin Panel</title>

<script language=JavaScript src="../templates/javascript.js"
type="text/javascript"></script>
<link href="../templates/styles.css" rel="stylesheet"
type="text/css">

<style>
body {background-color:white; font-family:verdana; font-size:11}
td {font-family:verdana; font-size:11}

input, select, textarea {border-width:1;
border-color:black;font-family:verdana; font-size:11}

.sub {background-color:#336699; font-family:verdana; color:white;
font-size:11; font-weight:bold; border-width:1; border-color:black}

.TableHead {background-color:#336699; font-family:verdana;
color:white; font-size:11; font-weight:bold;}

.RedLink {font-family:verdana; color:red; font-size:11;
font-weight:bold; text-decoration:none}
a.RedLink:hover {text-decoration:underline}

a.GreenLink {font-family:verdana; color:green; font-size:11;
font-weight:bold; text-decoration:none}
a.GreenLink:hover {text-decoration:underline}

a.BlackLink {font-family:verdana; color:black; font-size:11;
font-weight:bold; text-decoration:none}
a.BlackLink:hover {text-decoration:underline}

a.BlueLink {font-family:verdana; color:blue; font-size:11;
font-weight:bold; text-decoration:none}
a.BlueLink:hover {text-decoration:underline}

</style>

<script>

function CheckProfile() {

if(document.RegForm.p1.value=="")
{
window.alert('Enter your password, please!');
document.RegForm.p1.focus();
return false;
}

if(document.RegForm.p2.value=="")
{
window.alert('Confirm your password, please!');
document.RegForm.p2.focus();
return false;
}

if(document.RegForm.p1.value != "" && document.RegForm.p2.value !=
"" && document.RegForm.p1.value != document.RegForm.p2.value)
{
window.alert('Enter and confirm your password again!');
document.RegForm.p1.value="";
document.RegForm.p2.value="";
document.RegForm.p1.focus();
return false;
}

if(document.RegForm.FirstName.value=="")
{
window.alert('Enter your First Name, please!');
document.RegForm.FirstName.focus();
return false;
}

if(document.RegForm.LastName.value=="")
{
window.alert('Enter your Last Name, please!');
document.RegForm.LastName.focus();
return false;
}

if(document.RegForm.address.value=="")
{
alert('Enter your address, please!');
document.RegForm.address.focus();
return false;
}

if(document.RegForm.city.value=="")
{
alert('Enter your city, please!');
document.RegForm.city.focus();
return false;
}

if(document.RegForm.state.value=="")
{
alert('Enter your state, please!');
document.RegForm.state.focus();
return false;
}

if(document.RegForm.country.value=="")
{
alert('Select your country, please!');
document.RegForm.country.focus();
return false;
}

if(document.RegForm.phone.value=="")
{
window.alert('Enter your Phone, please!');
document.RegForm.phone.focus();
return false;
}

if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.RegForm.email.value))
{
return true;
}

alert("Invalid E-mail Address! Please re-enter.");
document.RegForm.email.focus();
return false;

}

</script>
</head>

<body>
<script>
function CheckNewPrice() {

if(document.f1.PackageName.value=="")
{
window.alert('Enter the new package name, please!');
document.f1.PackageName.focus();
return false;
}

if(document.f1.NewPrice.value=="")
{
window.alert('Enter the new price value, please!');
document.f1.NewPrice.focus();
return false;
}

if(document.f1.nDuration.value=="")
{
window.alert('Select a duration period, please!');
document.f1.nDuration.focus();
return false;
}

if(document.f1.pLevel.value=="")
{
window.alert('Select a priority level, please!');
document.f1.pLevel.focus();
return false;
}

}

function CheckDelete() {

if(confirm('Are you sure you want to delete this price?'))
{
return true;
}
else
{
return false;
}

}

</script>

<form method=post name=f1 onsubmit="return CheckNewPrice()">

<table align=center>
<tr>
<td colspan=2 align=center class=TableHead>Enter a new price</td>
</tr>

<tr>
<td>Package name:</td>
<td><input type=text name=PackageName maxlength=50></td>
</tr>
<tr>
<td>Price:</td>
<td><input type=text name=NewPrice size=6 maxlength=6></td>
</tr>

<tr>
<td>Duration:</td>
<td>
<select name=nDuration>
<option value=""></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select> months
</td>
</tr>

<tr>
<td>Priority Level:</td>
<td>
<select name="pLevel">
<option value=""></option>
<option value="1">1 - Standart</option>
<option value="2">2 - Bronze</option>
<option value="3">3 - Platinium</option>
<option value="4">4 - Gold</option>
<option value="5">5 - Premium</option>
</select>
</td>
</tr>

<tr>
<td>&nbsp;</td>
<td><input type=submit name=s1 value=Save class=sub></td>
</tr>

</table>

</form>
<table align=center width=650 cellspacing=0 bordercolor=black
frame=below>
<tr>
<td class=TableHead width=200>Package Name</td>
<td class=TableHead>Priority Level</td>
<td class=TableHead align=center>Duration</td>
<td class=TableHead align=right>Price</td>
<td class=TableHead align=center>Action</td>

<tr>
<td>0</td>
<td>Premium</td>
<td align=center>1 month</td>
<td align=right>$ 0.00</td>
<td align=center><a class=GreenLink
href="PriceEdit.php?PriceID=4">edit</a> | <a class=RedLink
href="PriceDelete.php?PriceID=4" onclick="return
CheckDelete();">delete</a></td>
</tr>

<tr>
<td>Shake Up</td>
<td>Gold</td>
<td align=center>2 months</td>
<td align=right>$ 34.95</td>
<td align=center><a class=GreenLink
href="PriceEdit.php?PriceID=6">edit</a> | <a class=RedLink
href="PriceDelete.php?PriceID=6" onclick="return
CheckDelete();">delete</a></td>
</tr>

<tr>
<td>Grow Up</td>
<td>Platinium</td>
<td align=center>1 month</td>
<td align=right>$ 25.00</td>
<td align=center><a class=GreenLink
href="PriceEdit.php?PriceID=5">edit</a> | <a class=RedLink
href="PriceDelete.php?PriceID=5" onclick="return
CheckDelete();">delete</a></td>
</tr>

</table>

<br><br>

Nov 25 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Novice Computer User wrote:
Hi. Can somebody PLEASE help. Here is a .php script. Right now, the
minimum amount of time (i.e. duration) allowed is 1 month. However, I
want to be able to reduce the minimum amount of time to 2 days (i.e.
48 hours).
There is no PHP in the code you provided. There are a couple of
unidentified <script> sections (probably javascript?).
Notes:
1. Your code will not work if javascript is disabled.
2. "Standart" should be "Standard"
3. "Platinium" should be "Platinum"
Can somebody PLEASE PLEASE tell me what I need to change in this file
to do this? Here is a copy - thanks enormously in advance:

Options:
1. Add a separate <select name="duration-days"> for short term packages.
2. Extend the existing <select> to allows short term options. The <option>
values would have to have "days" or "months" in the value so the backend
can decode the duration.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Nov 25 '05 #2

P: n/a
Your <option>s can simply include the value of the duration of the
period in hours. Alternatively, if the datatypes allow, our friend
might be best served by adding the line <option value="0.067">48
hours</option>

Nov 26 '05 #3

P: n/a
You will probably laugh, but I can't seem to figure out where/how to
make the correction you suggested -- so that I can have an option where
there is a trial for 48 hours instead of 1 month. Could you possibly
type in the exact line of text I need and/or show me exactly where to
put it in the script? This is a lot harder than I anticipated. Sorry.

Nov 29 '05 #4

P: n/a
Novice Computer User wrote:
You will probably laugh, but I can't seem to figure out where/how to
make the correction you suggested


Have you ever looked at the source of an HTML document before? Surely
you know how to search for text, so why not start with searching for
surrounding text in the document. Looking at the page in your browser,
you can see the control you wish to change has been labelled with
"Duration:" and has "months" written after it, so you could start by
searching for either of those.

Duncan also suggested the markup <option value="0.067">48
hours</option>, so you could also start by searching for other "option"
elements within the document. Doing that will lead you to this part of
the file:

<tr>
<td>Duration:</td>
<td>
<select name=nDuration>
<option value=""></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select> months
</td>
</tr>

Now, you should be able to use some common sense to work out how to
insert the suggested markup into that section appropriately. However,
simply inserting that markup will not make your server understand the
value when submitted, but server side processing is out of scope for
this newsgroup.

If you still have difficulty, start by looking up some HTML tutorials.
This looks like a relatively good start, google will find others for you.
http://htmldog.com/guides/htmlbeginner/

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox
Dec 1 '05 #5

P: n/a
Once upon a time *Novice Computer User* wrote:
You will probably laugh, but I can't seem to figure out where/how to
make the correction you suggested -- so that I can have an option where
there is a trial for 48 hours instead of 1 month. Could you possibly
type in the exact line of text I need and/or show me exactly where to
put it in the script? This is a lot harder than I anticipated. Sorry.


What suggestion, from who? Please, see the links in my sig for how to
quote and reply.
--
/Arne

* How to quote: http://www.netmeister.org/news/learn2quote.html#toc2
* From Google: http://www.safalra.com/special/googlegroupsreply/
-------------------------------------------------------------
Dec 1 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.