Resend my activation email : Register : Log in 
BCF: Bike Chat Forums


php help anyone

Reply to topic
Bike Chat Forums Index -> The Geek Zone
View previous topic : View next topic  
Author Message

craigie b
Citizen Smith



Joined: 26 Jul 2004
Karma :

PostPosted: 14:22 - 12 Sep 2008    Post subject: php help anyone Reply with quote

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. Thumbs Up
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

craigie b
Citizen Smith



Joined: 26 Jul 2004
Karma :

PostPosted: 14:23 - 12 Sep 2008    Post subject: Re: php help anyone Reply with quote

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. Thumbs Up
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

Dom
World Chat Champion



Joined: 06 Sep 2004
Karma :

PostPosted: 14:59 - 12 Sep 2008    Post subject: Reply with quote

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. Wink
____________________
Photos and that
 Back to top
View user's profile Send private message Send e-mail Visit poster's website You must be logged in to rate posts

Dom
World Chat Champion



Joined: 06 Sep 2004
Karma :

PostPosted: 15:07 - 12 Sep 2008    Post subject: Reply with quote

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. Razz
____________________
Photos and that
 Back to top
View user's profile Send private message Send e-mail Visit poster's website You must be logged in to rate posts

craigie b
Citizen Smith



Joined: 26 Jul 2004
Karma :

PostPosted: 15:17 - 12 Sep 2008    Post subject: Reply with quote

lol, I should point out I am modifying a plugin written by someone else and I have no idea how to code php....I've been pretty much working blind.

Can you explain a little bit clearer...whats the dot for?
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

craigie b
Citizen Smith



Joined: 26 Jul 2004
Karma :

PostPosted: 15:26 - 12 Sep 2008    Post subject: Reply with quote

Happy days I am making progress Thumbs Up Next thing....The date now appears on the same line....How do I move the date box to a new line? Karma Karma Karma
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

craigie b
Citizen Smith



Joined: 26 Jul 2004
Karma :

PostPosted: 15:51 - 12 Sep 2008    Post subject: Reply with quote

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=makeExtras($serviceid,$property_uid);
}
}
$output .=makedateoutput($serviceid,$validDates);
break;


I basically switched the makeExtras with the makedateoutput...I have no idea if this will have a knock on effect!
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

craigie b
Citizen Smith



Joined: 26 Jul 2004
Karma :

PostPosted: 17:17 - 13 Sep 2008    Post subject: Reply with quote

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 Laughing

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
View user's profile Send private message Send e-mail You must be logged in to rate posts

craigie b
Citizen Smith



Joined: 26 Jul 2004
Karma :

PostPosted: 23:11 - 14 Sep 2008    Post subject: Reply with quote

I can't thank you guys enough.....It took a further 6 hours of mulling over (and a previous 8 to find the fecking code in the first place) to final find a solution...... Most usefull was the tip about moving the dot. Once I sat down and thought about it overwritting the previous variable I did the following:-
Quote:

{
$datacheck=validateinputdata($request,$serviceid);
if ($checked && $datacheck) {
$validDates=getServiceAvailabilityDates($serviceid);
$output=makeExtras($serviceid,$property_uid). "<br>";
$output .=makedateoutput($serviceid,$validDates);
}
}
break;


A tiny change but I would have never have solved it without your help. Big big thanks to you all Thumbs Up Thumbs Up Thumbs Up Thumbs Up Thumbs Up
 Back to top
View user's profile Send private message Send e-mail 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?
  Display posts from previous:   
This page may contain affiliate links, which means we may earn a small commission if a visitor clicks through and makes a purchase. By clicking on an affiliate link, you accept that third-party cookies will be set.

Post new topic   Reply to topic    Bike Chat Forums Index -> The Geek Zone All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Read the Terms of Use! - Powered by phpBB © phpBB Group
 

Debug Mode: ON - Server: birks (www) - Page Generation Time: 0.07 Sec - Server Load: 0.49 - MySQL Queries: 13 - Page Size: 67.48 Kb