You should use: session_start();
just before you use
session_destroy();
Although the name of the function may not sound like it, it is PHP's way of first refering to and reconizing the session you are talking about - then it can be destroyed.
I'm not sure that this is directly related to PHP, but I'm using PHP for my output here so probably yes. When people successfully sign up for something on my website, I'm echoing 2 things.
1) A table containing the recipet of the information - i.e. re-confirming their deal
2) The fine print -...
This is weird - Isn't every unix timestamp day exactly 86400 seconds apart?
I compare 2 date timestamps, remove the lesser from the larger, divide that number by 86400 (number of seconds in a single day) and that gives me the exact number of days betwenn the two. as in following code...
I know that the following works very well:
<script LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
<!-- Hide script from older browsers
function validForm(ContactForm) {
for(j=0;j< ContactForm.plan_id.length;j++) {
el = ContactForm.plan_id[j];
if(el.checked == true){
return true;}}
alert("Please...
What's happening now using just the following:
AND kids.grade between '1' and '8'
is that it'll select grades 11 and 12 as well.
This is due to the field being a VARCHAR type. If I change the field type to the INT type all the alphabetical stuff inside are changed to a zero. What would be...
Please excuse my ignorance here. I have a column that contains numbers or letters. I'm trying to select something that matches either this or that. For example I'm working with a table containing a list of kids at a school. I want to pull any number between 1 and 12 so in my SELECT query I have...
I'm attaching a PDF document when sending an email message. The first part is plain text (Content-type: text/plain) second part is html and the 3rd part is the attachement. Now if I use multipart/alternative only the HTML is recieved, so I try using multipart/mixed but what happens now is that...
else { echo $_SESSION['site']; exit; }
That line for one doesn't make sense to me, because if the condition is true "exit" will then stop the script in its track right there
Quering a MySQL database with PHP, is it possible to find out if a particular column exists in a table, without outputing an error if in fact there is no column by such name?
Well, for the record, I finally got it to work. This is how it should be;
var s = document.cart_quantity["id[1]"].selectedIndex;
if (s== 0) {
alert("Please choose your item color");
Thanks to all
I have no choice... like i specified before it's part of a huge OsCommerce site and is very very dificult to change around (I would have to revise the whole system of how OsCommerce reads products in a basket and their attributes - something that is beyond my scope.
But if there are no errors...
Thanks tsuji
Alas its still doing the same. Javascript is not complaining - no errors at all - so it looks like it understands and recognizes my var:
var s = document.forms['cart_quantity'].elements['id[1]'];
...and it doesn't complain "s is not an object" anymore
But if I try any of these...
The script would need to be able to read the form and process it. This is usually done in languages such as PHP, VB, Coldfusion and many others, and is beyond Golive's scope. You cannot simply send a form to a email address. This is stated quite clearly in the Adobe Golive manual where forms...
ahh i see..
But lee is definitely onto something here , because i tried his example:
.elements['id[1]']; instead of .elements['id'[1]]; and Javascript is not throwing any more errors at me anymore. Problem is though, the validation isn't happening at all!
Current script:
function...
Thanks. I have to use them as this is part of a huge OsCommerce-driven site. And you know how tricky it is to tweak around OsCommerce....
I thought Javascript has no problem with those brackets when it comes to checkboxes, why would it go crazy if the field is a select?
Thanks cLFlaVA,
tried your suggestion but not working for me.
Code now reads:
function validForm(cart_quantity) {
var s = document.forms['cart_quantity'].elements['id'][1];
if (s.options[s.selectedIndex].value == '20') {
alert("Please choose your item color");
s.focus();
return false;
}...
I have a select (drop-down-menu) field in a form , and its name looks like this:
<select name="id[1]"> etc.
I'm trying to disallow a particular choice (the default one of "please choose" that I gave a value of 20) but I'm getting a Javasaript error:
"id.1.value is not an object"
The...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.