Jump to content

poddys

Members
  • Posts

    28
  • Joined

  • Last visited

About poddys

  • Birthday 10/11/1954

Contact Methods

  • Website URL
    https://www.thelaughline.com

Profile Information

  • Gender
    Male
  • Location
    Southampton, UK

poddys's Achievements

Member

Member (2/5)

0

Reputation

  1. Well, after much deliberation, trial and error - lots of errors and it was becoming a real trial too... I bit the bullet and am now rewriting everything to use absolute links. This way it works, but both the live and test site have to sit at the same level and be accessible using a domain. I can't use a base reset or anything similar because not all the pages are generated using php. But it works! Thanks for the help and for also acting as a sounding block.
  2. I used a relative url because our testing site has been using a sub-folder (domain.com/test/--rest of url--). Think I figured it though, because the url rewrite seems to work and runs the pgm, however the root is taken as the full original url, not just the domain.
  3. Aggghhhh forget it! It's something in the conf file that is redirecting when it finds a ".pgm" in the url, and it's obviously not trimming off everything in the url between the domain and the program name. Hopefully I can figure this out in the morning.
  4. I just figured out something, and I DID actually manage to get the vanity url's to work and stick in the browser address bar, however if my url is: http://www.mydomain.com/prodpage.pgm?name=750ml Orange Line Marker Spray Paint&item=41912 it is generating the page, but instead of the links within that page being at root mydomain.com they are at root mydomain.com/product/41912 so as a result the css and scripts are not loading. What do I change to fix this? I feel I am so close, and yet never quite there.
  5. I need to implement vanity url's on our web site, partly because they look "prettier" but more importantly because Google doesn't seem to like links that end in ".pgm" (many of our pages on our IBM iSeries are written using Websmart ILE and the program suffix is ".pgm"). I am halfway there, I think, but I am not sure if I am doing this right, and I still find taking examples of htaccess redirects and applying them to what I am trying to achieve pretty complicated. All the page links are coded correctly and are going to the right place, but the browser is showing the resulting url, not the link that is clicked on. Hopefully someone can help to steer me in the right direction if I explain what we have... The resulting link needs to be: http://www.mydomain.com/prodpage.pgm?name=750ml Orange Line Marker Spray Paint&item=41912 The vanity link should be: http://www.mydomain.com/product/41912/750ml Orange Line Marker Spray Paint I have this working using the following in .htaccess: RewriteRule product/(.*)/(.*) http://www.mydomain.com/prodpage.pgm?name=$2&item=$1 [L] However... the url that shows in the browser is the resulting link. I need it to be the link that is clicked on. Any thoughts please. I have tried lots of things but nothing seems to give the desired result.
  6. I was hoping for some guidance on this over the weekend, as I am still in the dark over what I am doing wrong. I guess people are too busy enjoying the nice weather, or also in the dark.
  7. I have a program with 3 select statements, each of which will be populated based on the selected value of the previous one. but for some reason it's not working, and I am tearing my hair out trying to figure out what I am doing wrong. The values of the selects are blank when the page loads, I have a script that detects the page has loaded, and this calls a task that populates the first dropdown. This works fine. I have a script that follows this which detects a change in the selected value of the first dropdown and is supposed to call a task to populate the second dropdown. This does not trigger at all. The only way I can get it to trigger is if I comment out the first script (initial load). I'm sure it's something simple, but for my simple mind (when it comes to JS at least) it's proving an impossible task, and I'm all Googled out. The input form code is as follows: <form method="POST" id="Form1" name="Form1" action="TIMINGTOOL.pgm?task=dspitems"> <span id="first-choice-code"> <select id='first-choice'> <option value='null'>Select A Manufacturer</option> </select> </span> <br> <span id="second-choice-code"> <select id='second-choice'> <option value='null'></option> </select> </span> <br> <span id="third-choice-code"> <select id='third-choice'> <option value='null'></option> </select> </span> <br> <div id="FirstError" style="color:red"></div> <div id="SecondError" style="color:red"></div> <div id="ThirdError" style="color:red"></div> <input type="image" src="images/GO_Up.gif" name="Go1" border="0" align="absbottom" id="Go1" /> </form> The scripts (which are just above the page footer) are as follows: <script> // Populate First Select On Page Load $(window).load(function(){ $.get("TIMINGTOOL.pgm?task=first" , function(data) { $("#first-choice-code").html(data); }); alert("select loaded"); }); </script> //script> // Populate Second Select On First Change //$("#first-choice").change(function() { // $.get("TIMINGTOOL.pgm?task=second&choice="+$("#first-choice").val() , function(data) { // $("#second-choice-code").html(data); //}); //}); ///script> <script> // Populate Second Select On First Change $("#first-choice").change(function(){ alert("The new value is: " + $(this).val()); }); </script> The "real" second script has been commented out in the above code, and replaced by one that detects a change in the dropdown and displays an alert. The first script is also set to display an alert so I can tell which is triggered. Any thoughts please. I know it could probably be coded better, but I am trying to keep it simpler based on my limited knowledge of Javascript and my even more limited knowledge of Jquery. Thanks in advance.
  8. BINGO! Thanks PFM, I guess it was staring me in the face all the time, there was a space before the ">". I changed this to use the following and it now works: $textstring = preg_replace('/cellspacing="0"[ ]*>/', 'cellspacing="0" width="100%"\>', $textstring); I was under the impression that the problem was the diamond, so leading myself on a false trail. Appreciate the speedy and rapid help. Tony
  9. Good thinking, but it didn't seem to work unfortunately. If I view the html text in Source mode using CKEditor it shows me ">" rather than ">" so I do believe this is not encoded. I changed my code to the following: $oldstring = 'cellspacing="0">'; $newstring = 'cellspacing="0" width="100%">'; $textstring = str_replace($oldstring, $newstring, $textstring); but no joy. The code is all on one line too, so no newline characters etc.
  10. I am coding a series of preg_replace expressions to try and strip unnecessary html/css code from text that was originally created using FCKEditor and is being copied programatically into CKEditor. All works well until I try to do a search/replace on a string that ends with a ">". No matter what I try this does not work, it either appears to do nothing or it errors and my resulting text is empty. In this case, if a table definition does not have a width defined, I want to add a width of 100%. The old/new strings and replace expression (str_replace in this case) are below. $oldstring = 'cellspacing="0">'; $newstring = 'cellspacing="0" width="100%">'; $textstring = str_replace($oldstring, $newstring, $textstring); It seems that the problem is related to the ">". If I take this out, it works ok. However I want to be sure that "cellspacing" is the last tag for a table definition (the tags were added automatically by FCKEditor and are always in the same order). Thanks for any help. I have been tearing my hair out for hours over this.
  11. I have a system that runs under Localhost and which uses Fopen to connect to an online system when the user logs in. If there is no internet connection, the Fopen fails immediately and the script catches that perfectly. If there is internet connection and the url is found, it is executed fine. The problem I am having is where there is an internet connection, but the url is not available, which happens if the user is using the wrong connection while in the office. In this case, the browser waits for about a minute, then gives a 500 error (MSIE). Is there an easy way to set a shorter timeout for this, so if the site/url cannot be found, the command fails? The reason for having the offline system is for engineers who have to create reports, but are often in environments where there is no network connection. They work offline and then upload the reports to the online system. As part of the login process, a script is run to download updates to tables, which only takes place if they are online of course.
  12. The bosses have decided that they want us to have product videos on our corporate web site, that can be downloaded by our distributors and sales reps, so that they can be shown to customers. Problem is, I can't think of the best way to do this. Currently we have our videos on good old YouTube, but the options to download from there are limited, in fact YouTube don't like videos being downloaded, and besides that you lose quality. We could have a gallery (Wordpress or BB based possibly or just incorporated into the main site), and could recommend options for downloading by using (a) online sites or (b) browser add-ons, but feel it's best if we can incorporate a button against each video, allowing it to be downloaded, ideally in different formats. The gallery would ideally need to allow visitors to search for videos by tags, and to allow categories as well. Any thoughts on a good script, or the best way to approach this? Thanks in advance.
  13. Thanks. Sorry for the delay in responding. That helped and is what I have ended up doing. It works well.
  14. They presumably click on a link to "Login", and as part of that action, the simplest thing is to either define the page url as a Global variable or as a Cookie. You can return to the user to that page (if set) once they have logged in.
  15. I inherited a system that "appears" to work most of the time, but on trying to figure out why it doesn't work 100% of the time I found that there are an enormous number of errors/warnings being reported in the Apache error logs. Although I know most (I hope most) of these are not serious and ought not to affect the workings of the scripts, I wondered to what extent the logging of the errors would have on performance. Sometimes these scripts do perform slowly, and I know that timeouts have been an issue in the past, where actions have not completed in time. I have extended the time alloted for scripts to run before a timeout, and I am gradually going through the scripts and trying to eliminate all of the errors (which range from variables not defined to MySQL errors).
×
×
  • 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.