PHP Syntax Error, Cannot understand what is wrong
This question is rather simple. Using the syntax below I get an error with
this line of code. Please help I cannot understand what I am doing wrong?
However if I change the line of code from an elseif statement to an if
statement I don't get an error. What is wrong?
Error line: elseif($weight <= 5000)
All of my PHP Code
if ($delivery == 'one') {
if ($weight <= 1000)
{
if (royal_s) {
$first = 'Royal Mail Small Parcels';
$first_p = '3.00';
$second = 'Parcelforce 24';
$second_p = '15.96';
} elseif (royal_m) {
$first = 'Royal Mail Medium Parcels';
$first_p = '5.65';
$second = 'Parcelforce 24';
$second_p = '15.96';
} elseif (parcelforce) {
$first = 'Parcelforce 24';
$first_p = '15.96';
} else {
sorry;
}
}
elseif ($weight <= 2000)
{
if (royal_s){
$first = 'Royal Mail Small Parcels';
$first_p = '6.85';
$second = 'Parcelforce 24';
$second_p = '15.96';
} elseif(royal_m) {
$first = 'Royal Mail Medium Parcels';
$first_p = '8.90';
$second = 'Parcelforce 24';
$second_p = '15.96';
}
elseif(parcelforce){
$first = 'Parcelforce 24';
$first_p = '15.96';
} else {
sorry;
}
elseif($weight <= 5000)
{
if (royal_m) {
$first = 'Royal Mail Medium Parcels';
$first_p = '15.10';
$second = 'Parcelforce 24';
$second_p = '16.92';
} elseif(parcelforce){
$first = 'Parcelforce 24';
$first_p = '15.96';
} else {
sorry;
}
}
}
}
Sunday, 8 September 2013
How can I insert div or img into textarea?
How can I insert div or img into textarea?
I'm trying to insert a div into textarea:
$(document).ready(function(){
$('#toclick').click(function(){
var text = '<div id="block"></div>';
$('#textarea').val( $('#textarea').val() + text);
});
});
<textarea id="textarea"></textarea>
<div id="toclick"></div>
But there's only HTML inside textarea instead of div. How to fix it?
I'm trying to insert a div into textarea:
$(document).ready(function(){
$('#toclick').click(function(){
var text = '<div id="block"></div>';
$('#textarea').val( $('#textarea').val() + text);
});
});
<textarea id="textarea"></textarea>
<div id="toclick"></div>
But there's only HTML inside textarea instead of div. How to fix it?
How to specify the directory for searching file all over the system
How to specify the directory for searching file all over the system
I am writing a file system program in C++. Now I try to write a file
finding function. First I want program be able to search the file in all
system. I use FindFirstFile and FindNextFile Windows API functions. First
I should call FindFirstFile , and give it the directory, where it must
search the file. But I don't know, how to specify the diirectory so that
FindFirstFile searches in all the system. Please, help me with that
question. I will be very grateful for any help.
I am writing a file system program in C++. Now I try to write a file
finding function. First I want program be able to search the file in all
system. I use FindFirstFile and FindNextFile Windows API functions. First
I should call FindFirstFile , and give it the directory, where it must
search the file. But I don't know, how to specify the diirectory so that
FindFirstFile searches in all the system. Please, help me with that
question. I will be very grateful for any help.
jQuery: do not add more clicks
jQuery: do not add more clicks
I hope to explain myself properly.
We have something like this (a simple example):
$('#click').click(function() {
$('#a').animate({width: 'toggle'}, 1500);
$('#b').animate({width: 'toggle'}, 1500);
$('#b').animate({width: 'toggle'}, 1500);
});
Now, if I click several times on "#click", even before the effects are
finished, my repeated clicks are added together and the function executed
multiple times (it's a really unpleasant thing especially when using
"hover", as you know).
But I would like that clicks are detected only if effects are finished.
How can I do?
I read the documentation about queue, but I'm not sure that will work in
this case.
Can I have some examples?
Thank you.
I hope to explain myself properly.
We have something like this (a simple example):
$('#click').click(function() {
$('#a').animate({width: 'toggle'}, 1500);
$('#b').animate({width: 'toggle'}, 1500);
$('#b').animate({width: 'toggle'}, 1500);
});
Now, if I click several times on "#click", even before the effects are
finished, my repeated clicks are added together and the function executed
multiple times (it's a really unpleasant thing especially when using
"hover", as you know).
But I would like that clicks are detected only if effects are finished.
How can I do?
I read the documentation about queue, but I'm not sure that will work in
this case.
Can I have some examples?
Thank you.
How can i make a online notepad?
How can i make a online notepad?
Hi lately ive been wondering how i could make a online notepad like
http://shrib.com i found that there was once a open source file here
http://www.teluguland.com/utilities/notepad/tester/notepad.zip but it
seems like its gone now.I am pretty sure that i need php and sql to make
one.Does anyone have the source file for a online notepad or the code i
need to make one?
Hi lately ive been wondering how i could make a online notepad like
http://shrib.com i found that there was once a open source file here
http://www.teluguland.com/utilities/notepad/tester/notepad.zip but it
seems like its gone now.I am pretty sure that i need php and sql to make
one.Does anyone have the source file for a online notepad or the code i
need to make one?
Saturday, 7 September 2013
Coonection to DSL failed after configuring Bridge
Coonection to DSL failed after configuring Bridge
Am having CentOs 6.4. After configuring bridge I am unable to connect to
internet through PPPoE Bsnl Dsl. I set up setting of bridge as follow:
DEVICE="br0"
NM_CONTROLLED="no"
ONBOOT=yes
TYPE=Bridge
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="br0"
I added BRIDGE= br0 at the end of eth0 file and set Nm_controlled= no.
After service network restart I am unable to connect to DSL service.
Am having CentOs 6.4. After configuring bridge I am unable to connect to
internet through PPPoE Bsnl Dsl. I set up setting of bridge as follow:
DEVICE="br0"
NM_CONTROLLED="no"
ONBOOT=yes
TYPE=Bridge
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="br0"
I added BRIDGE= br0 at the end of eth0 file and set Nm_controlled= no.
After service network restart I am unable to connect to DSL service.
how to choose what transform is applied first in css
how to choose what transform is applied first in css
problem: i want to skew box than rotate it but what happens is that it
gets rotated first and then skewed.
http://jsfiddle.net/74ehh/2/ see comment as i got it
As you can see this messes up the result so instead of box that's little
tilted and rotated. I get box that is rotated and tilted which's hard to
comprehend and not what i wanted.
i tried changing order like so..
transform: skew(30deg) rotate(30deg);
but that didn't work.
or could someone elaborate on how would i go about calculating skew if box
is rotated.
So what can i do?
problem: i want to skew box than rotate it but what happens is that it
gets rotated first and then skewed.
http://jsfiddle.net/74ehh/2/ see comment as i got it
As you can see this messes up the result so instead of box that's little
tilted and rotated. I get box that is rotated and tilted which's hard to
comprehend and not what i wanted.
i tried changing order like so..
transform: skew(30deg) rotate(30deg);
but that didn't work.
or could someone elaborate on how would i go about calculating skew if box
is rotated.
So what can i do?
Subscribe to:
Posts (Atom)