Jump to content

zimmo

Members
  • Posts

    171
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

zimmo's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. I was trying to refrain from posting, but its driving me mad and I am not sure what to do. Here is the issue. I have some rewrite rules and are making them better. But for now just need to know why this rule is giving me a page not found everytime. Firstly, this rule works fine: Options +FollowSymLinks RewriteEngine on # ## Rewrite rules for the instruments RewriteRule ^onlinestore/classical-guitar-new-arrivals/$ onlinestore/instruments.php?category=NA [QSA,L] So if I enter: domain.com/onlinestore/classical-guitar-new-arrivals/ it returns the page: domain.com/onlinestore/instruments.php?category=NA All works fine. However the next rule is giving me a page not found 404 error but I cannot see why. RewriteRule ^onlinestore/classicalguitars/([0-9]+)/?$ onlinestore/instrument_view.php?id=$1 [NC,L] I enter: domain.com/onlinestore/classicalguitars/472/ It should return the page: domain.com/onlinestore/instrument_view.php?id=472 But I get a page not found each time, completely stuck as to why? Any help appreciated as I want to improve the site. But need to get past this hurdle.
  2. Thanks all for the help o this, I will be looking at using an array and sorting it from there. And also for the comments on my code, its all a learning curve. Thanks Again )
  3. Can anyone help me with this xml as I very new to xml I have a folder on a server that gets xml files delivered to every day, the files have random unique names such as 2ee05c45-e004-4f52-955f-ba6f758d1bd3.xml so they are randomly listed in the folder by name. Now the script below reads through this directory and loads the results. Great, but what I need to do now is to order these results so that they are in date order. Now the date is contained within a field on each of the files. Is this possible and what do I need to do to sort them in date order, again very limited knowledge of xml, so any help most grateful.. <?php echo "<h3>Draw Name</h3>"; echo "<h3>Draw Date</h3>"; echo "<h3>Letters/Numbers</h3>"; echo "<h3>No of Shares</h3>"; { foreach (new DirectoryIterator('/location/to/folder/with/xml/files/in/') as $oFile) { if( $oFile->isFile() && ! $oFile->isDot() ) { $oXML = simplexml_load_file( $oFile->getPathname() ); // loop through simplexml object and assign value to variables foreach ($oXML->DrawResult as $entry){ $DrawName = $entry->DrawName; $DrawnDate = $entry->DrawnDate; $DrawnSymbols = $entry->DrawnSymbols; $NoOfShares = $entry->NoOfShares; // output the value of 'name' attribute of the first <title> echo "<h4>$DrawName</h4>"; echo "<h4>$DrawnDate</h4>"; echo "<h4>$DrawnSymbols</h4>"; echo "<h4>$NoOfShares</h4>"; } } } } ?> Here is a snippet from the xml file with the date in: <DrawnDate>10/23/2012 8:04:53 PM</DrawnDate> So just need to find a way to sort all these so we have the most recent first. Thanks again ;o)
  4. zimmo

    PNG Issue

    Thanks for this, I think this is the only way to acheive this. When you say 25% of the container div how would I do this. I have tried having a div left and right with the background, but when I set it to 25% it does not align correctly. I think this is due to the fact that the main container is not 75% of the window. I use the header 100% just for the background image (which is not working as its over the main view port). The acutal slide is 1030pixels wide (the image). So how would I work this if I have a set size image. Thanks again for your assistance.
  5. zimmo

    PNG Issue

    I am trying but failing to get this to work. I have used a slider (bxslider)and made some changes to it so that I have my other slides visible. Then I have added a background png so that the right and left images are covered with a transparent png with around 80% opacity. Now the problem I am having is that because I have applied this image to the div it is now stopping the links being active. Can anyone help me get this right, I need the transparent png to be over the main viewport so the right and left images are not fully shown. If you view this url you will see what i mean: http://www.barryzimmerman.co.uk/new/ When you see the text for each slide, it should be an active link to the website, but because of the png it is stopping this. I really want to achieve this, so any help much appreciated. The css files are here: http://www.barryzimmerman.co.uk/new/css/design.css http://www.barryzimmerman.co.uk/new/css/content.css Please help
  6. Its been a very long week ha ha... thanks for spotting the obvious...
  7. Thanks Mr Adam, I have just ran this script but put the request in manually. <?php $sql = mysql_query("select distinct club_town from clubs WHERE club_county = 'Greater Manchester' "); if (mysql_num_rows($sql) ==0) { echo ("<option selected>Choose your City</option>\n"); } else { $club_town = ""; while($row = mysql_fetch_row($sql)) { $club_town .= "<option value=\"$row[0]\">$row[0]</option>\n"; echo $club_town; } } ?> And it is returning the following: Manchester Manchester Altrincham In my database for Greater Manchester I have 2 records so it should only return: Manchester Altrincham
  8. Just to add to this, its only doing it for the one city/town. I have added more records to the database, but its only the first one that is returning 2 entries. Not sure why this is happening?
  9. I have a dropdown that is on two levels. The first drop down is populated with the county list from my database. It returns the county in a drop down of what data is in the database. Then when you select the county you want the second list is populated with the city. The problem I have is the second drop down is getting more than one of the same city. So for example if you select Greater Manchester in the drop down, it should return in the city drop down Manchester and Altringham, but it show manchester twice and altringham once, not sure why it is repeating the manchester one, as I am using select distinct? does any one have any idea why i get these results like this. Heere is the code for the drop down <form action="quick-results.html" METHOD="POST"><p align="right">Quick Find: <select name="region" onchange="ajaxrequest('select2',this.value)"> <option value selected="">Choose your County</option><?php echo $options; ?></select> <select name="club_town" id="select2" class="userinput"><option value selected="">Choose your City</option></select><input type="submit" value="go"></form></p> Then we have two scripts and an ajax file. Here is the script that generates the first drop down: <?php include("connect.php"); $sql = mysql_query("select distinct club_county from clubs ORDER BY club_county ASC"); $options = ""; while($row = mysql_fetch_row($sql)) { $options .= "<option value=\"$row[0]\">$row[0]</option>\n"; } $region = ""; $club_town = ""; if(isset($_POST)) { $region = $_POST["region"]; $club_town = $_POST["club_town"]; } ?> Here is the script for the second drop down that gets created based on the first <?php include("connect.php"); $request = $_POST["request"]; $sql = mysql_query("select distinct club_town from clubs WHERE club_county = '".$request."' "); if (mysql_num_rows($sql) ==0) { echo ("<option selected>Choose your City</option>\n"); } else { $club_town = ""; while($row = mysql_fetch_row($sql)) { $club_town .= "<option value=\"$row[0]\">$row[0]</option>\n"; echo $club_town; } } ?> And finally here is the ajax file function get_XmlHttp() { var xmlHttp = null; if (window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); } else if (window.ActiveXObject) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } return xmlHttp; } function ajaxrequest(tagID, post) { var http = get_XmlHttp(); var info = 'request=' + post; http.open("POST", 'inc/destinations.ajax.city.php', true); http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.send(info); http.onreadystatechange = function() { if (http.readyState == 4) { var mata = http.responseText.split("</option>"); for (i = 0; i <= (mata.length - 2); i++) { var container = document.getElementById(tagID); var newdiv = document.createElement("option"); if (i == 0) { container.innerHTML = ''; } newdiv.innerHTML = mata[i]; container.appendChild(newdiv); } } } } Help anyone?
  10. I have been searching google and have found some code where people have managed to do this. The code below works great now, I can specify holidays etc.. that are closed and also sundays being closed. I need to extend this, (not a javascript expert) so that I can specify mothers day and valentines day for delivery as well. Can anyone help me do this????? I need to change this code to allow for specific days that they are OPEN. It only allows closed days. <script type="text/javascript"> $(document).ready(function(){ $("#datepicker").datepicker({ beforeShowDay: nonWorkingDates, numberOfMonths: 1, minDate: '0', maxDate: '+12M', firstDay: 1 }); function nonWorkingDates(date){ var day = date.getDay(), Sunday = 0, Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6; var closedDates = [[7, 29, 2009], [8, 25, 2010]]; var closedDays = [[sunday]]; for (var i = 0; i < closedDays.length; i++) { if (day == closedDays[i][0]) { return [false]; } } for (i = 0; i < closedDates.length; i++) { if (date.getMonth() == closedDates[i][0] - 1 && date.getDate() == closedDates[i][1] && date.getFullYear() == closedDates[i][2]) { return [false]; } } return [true]; } }); </script>
  11. I am trying to extend my plug in by restricting the sunday from the calendar. I am not sure how to do this with my existing code. here is the code which is currently not working: <script type="text/javascript"> $(function() { // Tabs $('#datepicker1').datepicker({ beforeShowDay: function(date) { return [(date.getDay() > 1), ""]; } minDate: 0, maxDate: "+12M +0D", dateFormat: 'dd-mm-yy' }); }); </script> Can anyone see anything obvious?? Thanks Barry
  12. This is really getting me down, I have posted on numerous forums and getting nowhere? am I doing this the correct way, as I am getting nowhere. Is curl the right way to do this????? Please there must be someone who has done this type of thing before?
  13. Can anyone please help??? I have now managed to get the post data to submit okay, but the problem I have is the data is loading on the same page above my actual website. It is then loading the page at the top with the contents of the data? So I have my website where you submit the form and then when you submit it above that is another web page of the actual page that should be shown on its own on the other server? here is my code now foreach ( $_POST as $key => $value) { $post_items[] = $key . '=' . $value; } //create the final string to be posted using implode() $post_string = implode ('&', $post_items); //create cURL connection $curl_connection = curl_init('http://www.paymentgatewaysite.com/cf/pay.cfm?userid=123123'); //set options curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"); curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1); //set data to be posted curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string); curl_setopt($curl_connection, CURLOPT_POST, 1); //perform our request $result = curl_exec($curl_connection); if ($result) { echo 'curl post successful <br /><pre>'; print_r($result); echo '</pre>'; } else { echo 'curl post failed <br />'; echo curl_errno($curl_connection) . '-' . curl_error($curl_connection); } //close the connection curl_close($curl_connection);
  14. My script validates the data and then I assumed that once done and checked it would send the data to the third party which is where it needs to go? I have not used or done this before.
×
×
  • 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.