Announcement

Collapse
No announcement yet.

What's different? transfer to WHUK simplest codes and scripts not working

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • What's different? transfer to WHUK simplest codes and scripts not working

    Apologies if this is being posted in the wrong section. But, amongst other things it covers both php and MySql, so i would of had to duplicate the post in either of those forums. they are usually combined in most places as they are closely entwined with each other.

    I'm not placing blame on WHUK, indeed, i'll soon be scribbling a very favourable review of my dealings and experiences as a newcomer to their services and products.

    I've transferred my site from Lycos's servers to WHUK Windows hosting package. Aspects such as the transfer of the email went instantly without a hitch.

    However, i am aware of several glitches that i am going to have to laboriously address page by page on my site. Unfortunately, some of them i can't remedy until i figure out what the problem is. I would be grateful if anyone can give some pointers as to where problems are likely to lie.

    I'll give 4 examples.

    (1.)

    I'm mystified as to why certain things are happening. One example where i have to wade through my site script by script making a single alteration is as follows. On each page i have a small script from an external company that provides an excellent free stats service. The script worked perfectly for years on the lycos servers. A couple of lines read similar to;

    HTML Code:
    <!-- ENDADDFREESTATS.COM NORMAL CODE V3  -->
    however, when the page fails to display correctly (or at all) and i go to check the coding of the page that has been uploaded to the WHUK server it reads

    HTML Code:
    <!-- ENDADDFREESTATS.COM NORMAL CODE V3   -->
    Spot the difference? ok, there is an extra white space inserted at towards the end of the comment. Some of the pages have up to three lines altered in this way.

    Once i've corrected them and reloaded them to the WHUK server the page renders perfectly. No matter how many times i altered a web page on Lycos i never had this white space added.

    Additionally, i notice that within some pages, other types of code that needs to be written in one line is either split up or has an added white space into it causing it not to function.

    Is this likely because of a difference in the type of server??? or could it be to do with the FTP interface i use. Maybe the fact that 'Notepad' (which i use to hold and edit the text) is like most other Windows applications in that it opens up full window or any range of sized window totally dependent on how it was last used.

    By that i mean, if i typed a script in containing code that has to be precisely spaced out and i did that in a full window, however, when i go to edit it another time it opens up in a far smaller sized window would this affect the exact spacing of the original?. Only thing is, i'm pretty sure in the past i've had Lycos editing windows opening up in all sizes without detriment.

    (2.)

    My main index page has a live time and date facility that, i think is php based and/or contained in an 'i frame'. Most of the other pages (a lot of them in number to recode lol) uses a most basic SSI snippet of

    HTML Code:
    Today's Date Is <!--#echo var="DATE_GMT" -->~~~If this is not today's date, refresh page for updated version.
    Again a very basic thing that has always worked. Unfortunately, on every single page now it is hosted with WHUK it displays only the following on the actual viewable web page

    HTML Code:
    Today's Date Is~~~If this is not today's date, refresh page for updated version.
    I have checked to see that Server Side Includes is supported in my package and it is. What on earth can be the problem here?

    (3.)

    Wow! toil to come regarding the transferring of countless PHP MySql database scripts. If only for the connection code to be altered. However, i dabbled with altering one page to connect it to one of my WHUK tables. As far as i am aware it is the same php and MySql version as Lycos used.

    I use a form on a web page to search a database. The first part of the scripting is very basic

    [PHP]<?php
    [email protected]_connect("localhost", "usename", "password") or die("could not connect");
    [email protected]_select_db("database_name", $conn) or die("could not connect to database");
    $sql=stripslashes ("select * from table where $x like '%$y%' order by $z");
    $rs=mysql_query($sql, $conn) or die("could not execute query because ".mysql_error());[/PHP] it goes on to output a formatted list

    However i receive the following error message;

    HTML Code:
    'could not execute query because You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'like '%%' order by' at line 1'
    Can anyone possibly tell just from that info if it means i must recode every single line because of different versions of php MySql or not at all?.

    (4.)

    This last concern i'm just loosely mentioning as the prospect of getting my head around it or having to recode hundreds of more lines horrifies me lol.

    I had a quick glance at the DB interface within Plesk where you can run inquires away from a web page form input. As with Lycos upon returning a result of a search it displays the query with the result.

    GULP! never ever have i witnessed such lengthy gobbledegook lol. What on earth were the references to Latin and other things i saw. I haven't got the time right now to go back and generate and paste it, but presumably users on here know what i am referring to.

    The Lycos output and every other example i've seen in text books and in web tutorials never mentions half the syntax that was thrown in. My fear is that i have to add loads of words to every single database query embedded in my php scripts.

    If anyone knows what i refer to, can you plese let me know if it is just an anomaly of the Plesk interface and one does not have to actually add such baggage to a query?.

    Many sincere thanks to any assistance on the above questions.
    Last edited by perplexed; 19-02-09, 03:02 AM.

  • #2
    Hi, some post!

    1) i think if you are going to use notepad for coding, then turn of word wrap under 'format'. this could be your problem with the extra space.

    2) As far as the date function. it does look like a problem with ssi, but then again are you using a window server? If so, does echo work on a windows server? I'm not sure it does?? Was Lycos a windows server or apache?

    3) What does $x and $z represent? if they are chars and not numbers then try adding '$x' and '$z'

    4) afraid can't help with plesk

    Comment


    • #3
      Originally posted by jon123 View Post
      Hi, some post!

      1) i think if you are going to use notepad for coding, then turn of word wrap under 'format'. this could be your problem with the extra space.

      2) As far as the date function. it does look like a problem with ssi, but then again are you using a window server? If so, does echo work on a windows server? I'm not sure it does?? Was Lycos a windows server or apache?

      3) What does $x and $z represent? if they are chars and not numbers then try adding '$x' and '$z'

      4) afraid can't help with plesk
      Thanks for some good input. I'm off out for the evening but will try them tomorrow.

      (1) I was always told one should use notepad as it is near enough a pure text facility as opposed to say wordpad. The word wrap mention seems very viable as a cause, i will check it out. It never crossed my mind.

      (2) My computer has always been Windows. But, i presume you are referring to the web hosts servers? If so, yes, i am on the windows package with WHUK. Additionally, i seem to recollect the term Apache when i interacted with Lycos.

      Is it going to be a serious problem in all facets of coding and hosting in that i am on a Windows server then?

      I only chose the windows package as i thought it meant to do with ones own computer. I thought every web server in the world used Apache. Obviously, you can see i'm not well versed in servers and what apache is.

      (3) They are inut fields on the web page form. It has always worked perfectly for years in the syntax it is currently written. I'll implement the changes you mentioned tomorrow to test it.

      (4) I don't know if number 4 was entirely a Plesk related question. Possibly, more to do with the MySql version. Then again, maybe not, as i'm sure Lycos used the same version. I do know that Lycos had the latest version running.

      Comment


      • #4
        Hi, yes I think that you may have moved from a linux/apache server into a windows server environment.
        I think Windows server can handle mysql and php just the same as Lycos did, i think your problem probably is the newer version of PHP.

        1) you are right about using notepad, also great for copying MS word docs into it to remove all the horrible formatting.
        But when white space is an issue, always good idea to turn off word wrap.

        2) i think you will be fine with windows, it really depends on what coding you use, and if you want or need the remote desktop funtion. If your site uses just ssi, php and mysql then probably linux would have been better, but that is debatable!

        3) Again probably the updated version of PHP and Mysql.
        As for the date, hopefully someone will reply here as to whether "echo" is a problem on a windows server.
        I do think your mysql query needs the single quotes on vars that contain text though.

        4) i think you will need to send us some of the code it is throwing out.

        If your issues are server related, and a linux package is better for you, i have known folk on here ask support to change from one to the other, I think though that you maybe better to speak to support about your best option.

        Anyway good luck
        Last edited by jon123; 19-02-09, 10:05 PM.

        Comment


        • #5
          I won't have time until tomorrow to alter the code got a busy night ahead.

          I've just checked and Lycos used MySql 5 and php 4.3.10 & 5.2.3

          My site uses php (heavily), MySql and SSI.

          I have just checked and the 'standard' package that i have purchased DOES include SSI. So need help from anyone who can spot a problem in the syntax (worked perfectly for years, including the changes to later versions of code on Lycos).

          If it will help in assisting, the details of what services are available in my package are here (it is the 'standard' one)

          http://www.webhosting.uk.com/windows-hosting.php
          Last edited by perplexed; 19-02-09, 11:46 PM.

          Comment


          • #6
            Regarding the SSI problem, how come nobody thought on to suggest i check that the option was ticked within the setup section of Plesk

            As far as the php and MySql queries, i'll probably be better duplicating that part of this post in both php and MySql forums, as to be expected, they are tightly entwined.

            Comment


            • #7
              This all has the potential to become a nightmare. I've not even attempted to sort out the MySql/PHP stuff yet.

              Two developments i would please ask for input on.

              I have mentioned about the white space problems. Can anyone offer any explanation as to why the following happens every single instance without fail.

              Please note this isn't a third party FTP fault as it worked ok with the previous hosting company. In my FreeFTP application, i will edit a locally stored copy of one of my webpages. It is then a simple matter of dragging the file to the opposite window within the interface to my web server section. One gets a box popping up asking do you want to replace this current file with the new one. One clicks yes and that should be that - it always has been up until my switch here.

              However, if i should then go to my browser and view the webpage, all i will see is a blank white page with a totally indiscriminately situated viewable HTML code fragment. There is no set position or type of HTML code that shows itself each time.

              I then return to the FTP interface and (without opening the local file) redrag it to the web server section and am again asked the standard question by the pop-up box. If i then go to view the webpage in my browser it is there on display as it should be.

              Even if i leave only 2 seconds gap and redrag the edited file practically instantly from the local window to server window, the webpage will indeed display correctly when called up in the browser window.What on earth is the cause behind this?

              The second matter that has come to light is a shocker and i really am starting to despair. I'm not yet blaming my new hosting company, although i have held back a lengthy article of praise i wish to publish, until i'm sure the fault lies elsewhere.

              My computer uses IE7 and my website pages all display correctly, and even a basic slideshow runs without a glitch. However, the other day i posted a link in a forum to a jokey picture regarding the G20 summit that i uploaded to my site. The page merely contains a small jpeg and a snippet of code for a visitor count. My site has over 20 identically coded/scripted pages, all of which were uploaded with my previous webhost.

              They all display perfectly and always have done to others no matter what type of browser they use. However, with this page that i uploaded under my new host, with only the odd exception, poster after poster said they could not view the picture and it was just a white page or faulty in other ways. I went to my browser and yes i could view it without a problem.

              I have Firefox portable on a USB stick so i inserted that into the pc and called up the page, lo and behold nothing to see.

              I have just now run the page through a HTML validator and it fails as it shows an error....that error ahead of the HTML is an 'invalid character' appearing which is.....

              


              what on earth is that??????? it looks similar to something that appeared to my surprise in the returned query in the MySQL database interface within Plesk, be it latin acryllic or whatever. Please can someone give me an inkling of what is going on.

              The validator simply quotes 'Error: character not allowed in prolog'



              I've just quickly posted this in despair (lol) in the hope that somebody knows what is going on. Over the next few days i'll put more pages through validators etc to see what they come up with.

              Also, i'll give a few links if people can please be so kind as to tell me if my website is viewable at all outside of my computer???.....do i see my pages only because i have local copies of each page stored on my pc???

              All the pages on my site had originally passed full W3C HTML 4.01 & W3c CSS validation with flying colours.

              Maybe over time i might need to make the slightest of corrections to maintain their status after making the odd change here and there, but it would not be anything of significance.
              Last edited by perplexed; 06-04-09, 02:57 PM.

              Comment


              • #8
                URGENT EDIT

                As mentioned elsewhere, either in this thread or another lol. All of the pages within my website that i have not had reason to edit since transferring to this new host are fine. It is only those that i have had cause to amend that suffer from problems in being viewed.

                I have just very quickly run the 'validate whole site' option from the W3.org free service. I notice that the pages that have been edited on this hosts server quote 'Character encoding UTF -8' yet the old pages that have never been opened on my new server here read as being 'Character encoding unknown: presumed ISO-8859-7.

                Is this the key to the whole afffair?, if so where are my settings wrong? Is it within my windows notepad 'save as' optons or because the Lycos servers used the ISO encoding etc?????? What is the glaring error i'm committing?

                Comment


                • #9
                  Hi not sure what your first problem is but the second problem sure sounds like yhe chars set as you have already mentioned. Using the wrong type would give you that error when certain characters are used within your page.
                  I think that also you are correct in assuming that your editor is changing the chars type to 'charset=UTF-8'. Try looking at the options or 'save as' for a fix.

                  Comment


                  • #10
                    Thank you, i'll look into it and report back. it's got to be a setting somewhere along the way.

                    Comment


                    • #11
                      Thank you, i'll look into it and report back. it's got to be a setting somewhere along the way.

                      Do you know which character set i should be saving my scripts in? I was sure that in the headings of all my pages i had stated the charset, however, if the validator is 'presuming' encoding to be ISO-8859-7, maybe i omitted to do so?.

                      Clearly the pages i have edited and uploaded in notepad are being done so as UTF -8, or alternatively, this server has them as such???.

                      I'm not sure which character set i should use, i'll do a little research and try and see if anywhere in my hosting interface there is an option selected for one or the other.

                      Comment


                      • #12
                        I'm not sure really tbh because i'm unsure of the differences between a windows server and a unix one, but if ISO-8859-7 works for you then that is the charset i would use. I believe there is also a windows charset available, windows 1256, maybe try that? <!-- / message -->. All my pages use utf-8 as my editor auto creates this set type.

                        Comment


                        • #13
                          Originally posted by perplexed View Post
                          I have just now run the page through a HTML validator and it fails as it shows an error....that error ahead of the HTML is an 'invalid character' appearing which is.....

                          


                          what on earth is that??????? it looks similar to something that appeared to my surprise in the returned query in the MySQL database interface within Plesk, be it latin acryllic or whatever. Please can someone give me an inkling of what is going on.

                          The validator simply quotes 'Error: character not allowed in prolog'
                          The above is one of the problems i have come across and posted on earlier.

                          I have now seen a similar post on the web from someone which reads as follows;

                          'Validation Warning Byte-Order Mark found in UTF-8 File
                          Morning,
                          Yesterday, when I was working on a website for a friend, I tested my code via the W3C.org website and, even though it validated OK, I was shown the following message:
                          Warning Byte_Order Mark found in UTF-8 File
                          What the heck does that mean?
                          According to W3C, this in itself is not a problem. But, it may present difficulties with older browsers. Well, I cant have that!
                          With IE6+ there does not seem to be any visible oddities, but, Firefox 2 has added this to the top of the page:

                          

                          How bizarre! I checked my source code and there is nothing in there that would explain these characters being visible.

                          A little bit of research and I found out that this is all to do with how the text file is encoded and saved. So, whats the solution? Very simple actually.

                          I opened the .html file in notepad.
                          Clicked Save As
                          In the dialog box, change the Encoding field value to ANSI
                          Save and transfer to server.

                          Simple. Not only did the bizarre characters disappear, but, I no longer get the warning for the W3C validator.'



                          Now before i attempt that as a solution i need to ask a question. I have noticed that the vast majority of webpages are UTF-8 encoded.

                          Will i be able to save my edited Notepad webpage on my computer and WEBFTP interface as ANSI but have the webpage on the internet denoted as UTF-8 ?

                          Comment

                          Working...
                          X