|
|
| Author |
Message |
| craigie b |
This post is not being displayed .
|
 craigie b Citizen Smith

Joined: 26 Jul 2004 Karma :     
|
 Posted: 14:22 - 12 Sep 2008 Post subject: php help anyone |
 |
|
Hi guys....I am trying to edit the following code:
| Quote: | if ($wrapable=="1")
{
$cost=getCost($requestedQuantity,$serviceid);
$quantityAvailable=getWrapableSlotsAvailable($serviceid);
$output=makewrapablequantityoutput($defaultQuantity,$quantityAvailable,$serviceid);
}
else
{
$datacheck=validateinputdata($request,$serviceid);
if ($checked && $datacheck) {
$validDates=getServiceAvailabilityDates($serviceid);
$output=makedateoutput($serviceid,$validDates);
}
}
$output.=makeExtras($serviceid,$property_uid);
break; |
Now the line "$output=makedateoutput($serviceid,$validDates);" creates a drop down menu and populates it with dates.
The line "$output.=makeExtras($serviceid,$property_uid);" creates a list of check box options, called optional extras in the pic attached.
Now all I want to do is have the optional extras appear above the date box instead of below. However when I move the "$output.=makeExtras($serviceid,$property_uid);" line above the command to create the date box, the extras simple do not appear. Can anyone help? Lots of good Karma to anyone who can help.  |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| craigie b |
This post is not being displayed .
|
 craigie b Citizen Smith

Joined: 26 Jul 2004 Karma :     
|
 Posted: 14:23 - 12 Sep 2008 Post subject: Re: php help anyone |
 |
|
| craigie b wrote: | Hi guys....I am trying to edit the following code:
| Quote: | if ($wrapable=="1")
{
$cost=getCost($requestedQuantity,$serviceid);
$quantityAvailable=getWrapableSlotsAvailable($serviceid);
$output=makewrapablequantityoutput($defaultQuantity,$quantityAvailable,$serviceid);
}
else
{
$datacheck=validateinputdata($request,$serviceid);
if ($checked && $datacheck) {
$validDates=getServiceAvailabilityDates($serviceid);
$output=makedateoutput($serviceid,$validDates);
}
}
$output.=makeExtras($serviceid,$property_uid);
break; |
Now the line "$output=makedateoutput($serviceid,$validDates);" creates a drop down menu and populates it with dates.
The line "$output.=makeExtras($serviceid,$property_uid);" creates a list of check box options, called optional extras in the pic attached.
Now all I want to do is have the optional extras appear above the date box instead of below. However when I move the "$output.=makeExtras($serviceid,$property_uid);" line above the command to create the date box, the extras simple do not appear. Can anyone help? Lots of good Karma to anyone who can help.  |
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Dom |
This post is not being displayed .
|
 Dom World Chat Champion

Joined: 06 Sep 2004 Karma :  
|
 Posted: 14:59 - 12 Sep 2008 Post subject: |
 |
|
Without seeing the PHP functions or the markup produced it's difficult to say, but I'm guessing it's a HTML problem.
My guess is you've got fields being generated within fields, or something like that, and the browser doesn't know what to do. Tried running the page through https://validator.w3.org/?
Sod that, I think the problem is that you've probably missed the '.' before the equals, which means the variable is overwritten rather than added to. F'rinstance you have '$output=makedateoutput($serviceid,$validDates);' which would overwrite any variable already called $output that is created earlier in the script (which presumably it would be if you move it up).
Add some tabs and spacing and your life would be much easier.  ____________________ Photos and that |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Dom |
This post is not being displayed .
|
 Dom World Chat Champion

Joined: 06 Sep 2004 Karma :  
|
 Posted: 15:07 - 12 Sep 2008 Post subject: |
 |
|
| LukeVFR wrote: | | Code: | <?php
$variable = "test";
$variable .= "ing";
echo $variable;
?> |
That would output "testing"
You need to call the second variable declaration something else if you want to use it above the original variable declaration. |
No he doesn't, he just needs to move the dot accordingly.  ____________________ Photos and that |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| craigie b |
This post is not being displayed .
|
 craigie b Citizen Smith

Joined: 26 Jul 2004 Karma :     
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| craigie b |
This post is not being displayed .
|
 craigie b Citizen Smith

Joined: 26 Jul 2004 Karma :     
|
 Posted: 15:26 - 12 Sep 2008 Post subject: |
 |
|
Happy days I am making progress Next thing....The date now appears on the same line....How do I move the date box to a new line?  |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| craigie b |
This post is not being displayed .
|
 craigie b Citizen Smith

Joined: 26 Jul 2004 Karma :     
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| craigie b |
This post is not being displayed .
|
 craigie b Citizen Smith

Joined: 26 Jul 2004 Karma :     
|
 Posted: 17:17 - 13 Sep 2008 Post subject: |
 |
|
Ah...I have discovered what happens when I switch the variables....the date function now only appears if there is extras attached to it so my bodge didn't work
So what I need to do is set a new variable to show the extras....how do I define a new variable? (if that is what I need to do) |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| craigie b |
This post is not being displayed .
|
 craigie b Citizen Smith

Joined: 26 Jul 2004 Karma :     
|
 Posted: 23:11 - 14 Sep 2008 Post subject: |
 |
|
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
Old Thread Alert!
The last post was made 18 years, 2 days ago. Instead of replying here, would creating a new thread be more useful? |
 |
|
|