473,408 Members | 2,813 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,408 software developers and data experts.

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

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
5 1983
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Philip Mette | last post by:
I am begginner at best so I hope someone that is better can help. I have a stored procedure that updates a view that I wrote using 2 cursors.(Kind of a Inner Loop) I wrote it this way Because I...
5
by: Craig Keightley | last post by:
Please help, i have attached my page which worksin IE but i cannnot get the drop down menu to fucntion in firefox. Any one have any ideas why? Many Thanks Craig ...
1
by: Colm O'Brien | last post by:
I have a field called year end month where records hold the month financial year end for accounts is stored. i need to query the data base and return all records where year end month is less...
7
by: Novice Computer User | last post by:
Hi. Can somebody PLEASE help. I have spent hours on this.. but I am a total novice and can't seem to figure it out. Here is a .php script. Right now, the minimum amount of time (i.e. duration)...
2
by: coinjo | last post by:
#include<fstream> #include<iostream> #include<cstring> using namespace std; struct date { int day, month, year; };
21
by: Marina | last post by:
I've spent 2 months working on this Access 2003 db, get something done and then the 'boss' wants something different that what was originally stated, or wants to add this or that. It's been nuts,...
11
by: samuelberthelot | last post by:
Hi, I've got 3 input HTML (dropdown lists) on my page. One for selecting a Month, one for the day, one for the year. Very simple... My problem is that I'd like to update the Days one according...
1
by: tgregg6 | last post by:
These problems have been given me troble for a couple of days please help me!!! problem 1: This program calculates the charges for DVD rentals where current releases cost $3.5 and all others cast...
7
by: John | last post by:
I have a table with amongst others 2 fields: DateIn and DateOut. The idea is to make a chart that shows the average number of days it takes for a request to be answered. I'm planning to make a...
3
by: jenipriya | last post by:
Tables ------------ Employee (EmpID, EmpName,DeptID DateOfJoin, Sal, Addr) Finance (EmpID, Sal) Club (Clubname, EmpID, Fee, DateOfJoin) Leave (EmpID, Date) Department (DeptID, DeptName,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.