Jump to content

Kristoff1875

Members
  • Posts

    242
  • Joined

  • Last visited

Everything posted by Kristoff1875

  1. To answer as simply and honestly as I can, because I need to!! I'm not a total noob to php and I've made databases based on users input before and also pulling data from a database. I know what an array is, but, at least in instances like this I've had very little experience. Always happy to read, look at examples and tutorials and ready to learn! I'm guessing from your shock at the use of the array function that I shouldnt touch that until I'm posting it to the database? Just to clarify, in comparison to a fair few on here, I will be classed as a noob! But I feel I know a bit more than a proper noob!
  2. Because to be honest, I have no idea what i'm doing with getting the array to post. I need it to post to one field on the database called "damage". Whenever I tested the value before, I got nothing. And after some research I found a bit of code using that and when I tried it, I actually got the array posted to the next page. Should that just be $damage= $_POST['damage'];? As that's what I had before, and it didn't pass anything at all.
  3. Right, another question!! (nearly the last, if not the last, promise!) I am using a modified version of bsmselect to let people choose 3 different variables and add them in to one, for example: LIST A + LIST B + LIST C Which then when a button is clicked, is added to the bsmSelect. When the form is then submitted, when it gets to the next page i'm doing the following: $damage=array($_POST['damage']); To post the data to a value, which when using print_r($damage); is displaying the full array: Array ( [0] => Array ( [0] => Front Wheel N/S (16) > Curb Mark x 2 [1] => Front Wheel O/S (17) > Paint Peel x 3 [2] => Rear Windscreen (10) > Chip (Large) x 5+ ) ) So now i'm totally stuck! I have no idea how I get the array from here, stored in to the session and then sent to the MySQL database. I've tried dozens of things, but it just ends up with me getting an "Array" value in the database, or nothing at all. Any ideas much appreciated. Cheers guys.
  4. When I said next, I meant as in that was the next thing I was going to do on the project! I've done it, and it works! I am very thankful! And luckily, as the project is not yet live, there aren't any meaningful rows in the database yet.
  5. Yep, i'm going to work on that next! Thanks
  6. I'm now utterly, utterly confused. On 2 different pages, that pull rows with 2 different ID's, there is 1 field that has an identical value, in the same field. On one page, it doesn't show it. On the other, it does show it... ARGH!
  7. And for anyone else looking in, don't speak too soon! For some reason, one of my fields that was struggling to spot the extra spaces is now hiding fine, but the exact same code on a different value with the same issue, is still not working! :'(
  8. One thing that is has been confusing me at the moment is that i'm getting 1 value delivered to the database at certain times that actually has a few spaces, but appears empty: " " but searching to see if it's empty, is not working, as it's not empty! What is the best way to handle this type of value? Is there a way I can check this, or is it something I should do when it's added to the database, to say "if this value doesn't contain.... then value equals blank" ? Or would the trim function work? For anyone looking in, I answered my own question, the trim function did work!
  9. That's cool thanks. I understand most of the keys below, I just hadn't ever seen it used as per the example offered. From the comments, it seems to be a shorter way of doing this, is that correct?
  10. Just tried that and I think it's working. Thanks for your help. Out of interest, how is it working? Is the (!empty($info['contactother']) ? Basically asking 'contactother' is not empty, and the ? is acting like an if statement for the following code?
  11. Perfect, many thanks. Am I able to manipulate that, for example: ' . (($info['hearabout']) == "Other" ? ' <tr> <td align="right" style="background:#C8E9EB; border-top: solid 1px #CCCCCC; border-left: solid 1px #CCCCCC;">Other:</td> <td align="left" style="background:#C5D7EF; border-top: solid 1px #CCCCCC; border-left: solid 1px #CCCCCC; border-right: solid 1px #CCCCCC;">' . $info['hearother'] . '</td> </tr>': NULL). ' To show the other details held in "hearother" if "hearabout" is set to other? Cheers
  12. That's brilliant thanks, and worked perfectly apart from..... Anything after the :NULL); code is now removed?
  13. Apologies, i'd not seen the function used in that way before so didn't realise there was an alternative way of using it. Will take a look now, thanks.
  14. Thanks for that, that works brilliant for displaying a Not Available tag instead of a blank field, but what i'm after really is something I can place before the <tr> tag, to say if it's available, show the next row, if not, then display nothing? Cheers
  15. I've got a call from a MySQL database that is doing the following: while($info = mysql_fetch_array( $data )) echo '<table width="550" border="0" align="center" cellpadding="10" cellspacing="0"> <tr> <td width="175" align="right" style="background:#C8E9EB; border-top: solid 1px #CCCCCC; border-left: solid 1px #CCCCCC;">Name:</td> <td width="335" align="left" style="background:#C5D7EF; border-top: solid 1px #CCCCCC; border-left: solid 1px #CCCCCC; border-right: solid 1px #CCCCCC;">'.$info['name'].'</td> </tr> <tr> <td align="right" style="background:#C8E9EB; border-top: solid 1px #CCCCCC; border-left: solid 1px #CCCCCC;">Email:</td> <td align="left" style="background:#C5D7EF; border-top: solid 1px #CCCCCC; border-left: solid 1px #CCCCCC; border-right: solid 1px #CCCCCC;">'.$info['email'].'</td> </tr> But i've tried a load of different things, for example: 'if($info['email'] != "") { echo "Yes"; } else { echo "No";}' Just to try and get a different result to show it's working, but every time, whether there is an email or not, it's giving me the same result. Anyone got any ideas?
  16. Scrap it... Can I just say thank you to this forum... I've spent the last 4 hours trying to figure something out on here, and as I typed it out, the problem became clear!!!! Thank you for being here, I wish i'd come earlier!!!! :'(
  17. Sorted, I missed out a value where the xml values are called in to PHP values.
  18. The new service does provide a remote XML when the details are completed in the form, which is what the old service did also. I think it's just the way it handles it is different?
  19. I was retrieving XML from a remote server using the following from a form: ob_start(); //extract data from the post extract($_POST); //set POST variables $url = '***'; $fields = array( 'ESERIES_FORM_ID'=>urlencode('**'), 'MXIN_USERNAME'=>urlencode('**'), 'MXIN_PASSWORD'=>urlencode('**'), 'MXIN_VRM'=>urlencode($regHome), 'MXIN_TRANSACTIONTYPE'=>urlencode('**'), 'MXIN_PAYMENTCOLLECTIONTYPE'=>urlencode('**'), 'MXIN_CAPID'=>urlencode('**') ); //url-ify the data for the POST foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } rtrim($fields_string,'&'); //open connection $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_POST,count($fields)); curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string); //execute post $result = curl_exec($ch); //close connection curl_close($ch); $str = ob_get_contents(); ob_end_clean(); But now I need to use a new provider and I think the service is being handled a different way. I've swapped the necessary values in the form to send to the remote server, but i'm not having any joy in receiving anything back, so wondering if it handles a different way? I've been provided the following: https://www1.carwebuk.com/CarweBVrrB2Bproxy/carwebVrrWebService.asmx?op=strB2BGetVehicleByVRM Thanks in advance
  20. Ah ok, thought you'd used it before!! Thanks anyway!
  21. Liam, quick question you may be able to help me out with if you're experienced with bsmselect... I understand that when you select the option, and it goes below, it's greyed out on the menu because it then becomes a selected item on the dropdown. Is there any way of having the same selected item added to the list again? Or even adding a new option to the list cloning the selected item when it is chosen? Hope this makes sense. Cheers Chris
  22. Liam, it is perfect for what I need, thanks!
  23. That bottom example looks really really neat, neater than I actually imagined!! Will give it a go now, thanks Liam!
  24. Hi guys, Basically what I am doing at the moment is having users select what part of their car is damaged and then selecting how bad the damage is. I've been trying a few different ways and so far nothing is working quite like I need. However, i've just found, ASM Select, and I really like the way it works, thinking that a list of the damage would be ideal.... Now what I am wondering, if I use this script, would I be able to use it over 2 dropdown selection boxes and display both answers? For example when the users chooses "Front Bumper" in the first dropdown, and then "Dent (Large)" in the second, can I make it display the result in the box as "Front Bumper > Dent (Large)"? Just looking for a bit of advice before I attempt it! Cheers in advanced guys.
  25. Told you an expert would be along to help!!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.