Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

About euc

  • Rank
  • Birthday 05/01/1951

Previous Fields

  • Languages
    PHP, HTML, Javascript

Contact Methods

  • Website URL

Profile Information

  • Location
    Adelaide South Australia
  • Interests
    My wife, computers, amateur radio, botany, astronomy, growing things, biochemistry, building/making things, travel and learning as much about the universe as I can.
  1. dsonesuk Exactly. That's what I was looking for. iPhone uses what it wants, not what you set in the style sheets. So someone else did notice. Thanks. You have confirmed what I am saying. Most iPhones use Chrome on Android. Question - is it Android or Chrome? I suspect Chrome so I guess I wil have to download that to my PC and see what happens. Funny thing is that my wife's tablet has Android and Chrome and the iPhone also but they both behave differently. Things that work on the tablet don't work on the iPhone. Actually I have a website that I wrote 7 years ago and haven't touched since. It doesn't use CSS style sheets but does all the formatting in HTML but works fine on tablets, iPhones and PCs. It was my first effort using PHP so excuse the basic nature and mistakes. I am also an amatuer radio operator so just Google VK5AJL (my callsign) and you'll find it. It's just lazy programming really. They should all work the same. It's no wonder many sites have entirely different sites for PC,s or Android. If Android is detected they serve one set of pages but if not another.That should not be necessary. Thanks again.
  2. Javascript is a client side scripting language and will not solve your problem because it hasn't got access to the file system on your server. A client side script (like Javascript) is one that runs on the computer that receives and displays the page. A server side script (like those mentioned below) is run on the computer that sends the page. You are stuck with a server side script like Python, Perl, ASP, PHP or dialects like Hack, or something. There is no easy one line fix for your specific problem which, as I understand it, is how to automatically update a menu page, iframe or similar by simply uploading another HTML file. In my post above I gave you the shortest method I could think of that does PRECISELY that. Maybe someone else can do better. On the other hand, if your problem is just updating several pages, and you don't mind updating the menu file, use an <IFRAME>. You can do that entirely in HTML.
  3. I didn't ask for answers because I have already worked around the problems already. You really should read posts more carefully. I asked if anyone else had noticed that. My CSS is valid because it works fine on my PC. I can change anything in the style sheet and it works and changes what I want to what I want. It's only on Android devices but it isn't necessarily Android. I know Firefox and IE treat some attributes differently. I have a dozen browsers I switch between to test pages which is more than most do. I can absolutely gaurantee that I have semicolons between attributes. I am a Newbie to the forum but I am not an idiot or a beginner. I have been programming computers for 20 years longer than you have been alive and one thing I am good at is finding bugs and inconsistencies. The issue is that the exact same style sheet works differently on different devices in that some attributes are ignored by some.
  4. This not a problem I want answers to. I have managed to work around them myself anyway. I just want to know if anyone else has the same problems. I am writing a web page at the moment I want to be PC, iPhone and tablet friendly. I have noticed that on my PC evrything looks fine but when I view it on an iPhone or tablet (both with Android), I notice that many settings in the style sheet that work on the PC don't work on the Android devices. The culprit could just be Google Chrome because both the android devices use that and I definately don't use that on my PC. Issue 1) I wanted to make the links a little bigger than normal text so users would not have to expand the screen to press one or bash it with a pen. I like big links on the PC also to make them easy to get the mouse over. It's a lot easier for old people, people with Parkinsons or poorly sighted to use. The PC made the links bigger but, no matter what I did with the style sheet, the links on the iPhone and tablet were so small, only a Geek with their nose up against the screen and glasses thicker than their head could read it. (No offence to people with glasses, I wear them myself.) I had to insert special HTML code with extra style information to overcome this. Issue 2 - almost the same) Other CSS attributes were also ignored like text-align:"center" (and others) from many of the definitions although in these others I could change the colour, size and so forth. (Worked fine on the PC. It is so bad sometimes I wonder whether it's worth using style sheets at all because I don't know which are going to be ignored on what platforms although I do think they are a great idea. Issue 3) I think there should be an addition to CSS. There should be a default that comes at the start so that every single character and every single field for the rest of the page default to that. Then you can redefine anything else you want. It would allow you to choose what you want instead of what some lax programmer thinks everybody wants. There were other difficulties as well but not CSS related. What about it, anyone else had such difficulties?
  5. euc

    understanding php line

    This is only a "I think so" don't quote me although $_SERVER["argv"][0] is certainly a 2 dimensional array and the PHP manual stays "argv Contains an array of all the arguments passed to the script when running from the command line." It is possible to set up PHP to run from the command line you type into your own computer, that is, I think without a separate server for your own use only. I have a server so it's of no use to me and don't know the details. When you type commands into your command interpreter like "copy file1 file2" the two arguments are "file1" and "file2" so if you have PHP setup in this manner $_SERVER["argv"][0] would be 'file1' or it could be 'copy' - like I said "never tried it". $_SERVER["argv"][1] would be 'file2' or it could be 'file1' - ditto $_SERVER["argv"][2] could be 'file2' - ditto
  6. I did consider the names of the links when I said "This does not change the title displayed in the list and uses only the original HTML filename. It takes only one or two lines of code to extract the title from the HTML document." I just didn't bother. I don't think he is interested anyway because of his comment "I was just hoping there would be a simple HTML solution" To do what you say certainly works but he also has to modify the file "menu.html" every time he uploads a new file. He might as well just edit the unordered list in the first place. Your solution is back to square 1. Actually, while we are on the topic of doing it anywhere, I think it would be really nice if the HTML <LINK> tag could do more than just download style sheets directly into the browser. This still would not have answered Beareaters original question but I would use it a lot.
  7. euc

    apache version for php

    I looked up the documentation that came with my first version of PHP (can't remember) called "php_manual_en.chm", typed "apache" into the search and there is quite a bit. This manual is quite old but mentions PHP running on Apache 1.3 and onwards but the PHP version I have is 5.4. This is also old but does everything I want. If it isn't broken, don't fix it. It's a case of the driver before the cart before the horse. You don't get the documentation until you install PHP but it's better to install Apache first. Anyway, my manual confirms there is considerable overlap.
  8. euc

    understanding php line

    argv is for command line use and not relevant to web pages. It is a list of arguments passed to the script when you type a command into PHP set up like a normal application like a C or Pascal program. $_SERVER["argv"][0] means $_SERVER is a two dimensioanl array. "argv" is the first dimension making it similar to other $_SERVER contents like $_SERVER['PHP_SELF'] but instead of being a single value, it is an array. To access each of the arguments in this array you need the second dimension ie the [0] for the first, [1] for the second and so on.
  9. Foxy Mod. That still does not answer the original issue. How can I simply upload another HTML file and include it in the unordered list. What PHP code would you put in the include() file? All include does is to simply insert the lines in that file into the original file. This guy is obviously a real beginner and wants a simple solution. Having PHP read a single file, whether it's in the include or not, and serve poems from that file is a lot more complicated than my solution above. Of course you can't simply run it from a home computer, like you can HTML, unless you have a web server like Apache and PHP installed. If you insert my code into the original HTML where th list items are, it will work on such a server.
  10. PHP "include" does not address the problem of how to scan through a folder that changes. Because an include file inherits the context of the script that included it, it doesn't solve the problem of doing it anywhere either. The only thing an include file does not inherit is PHP mode. Even $_SERVER['PHP_SELF'] returns the value of the calling script. The following code, delimited with the "=" signs but not to be included, will do the job of automatically updating the display page. Any problem whatever like no such folder, nothing in it or permissions not set, is accounted for. If there is a normal file called WhateverFolder, it won't crash the script but it won't find anything. Replace WhateverFolder with the name of the folder you create to hold your content. This does not change the title displayed in the list. That will be displayed here as the HTML file name. It takes only a few extra lines of code to extract the title from the HTML document. ============================================================================ <?php $NothingFound = true; if ($DirHandle = @opendir ('/WhateverFolder/')) { while ($Content = readdir($DirHandle)) { if (!is_dir($Content)) { echo '<li><a href="/WhateverFolder/',$Content,'"</a>',$Content,'</li>'; $NothingFound = false; } } closedir ($DirHandle); } if ($NothingFound) echo '<li>Sorry - nothing available</li>'; ?> ============================================================================ This accounts for directories but doesn't account for other files that are NOT HTML. If this is a problem, the 5th line can be replaced with this:- if (!is_dir($Content) and strtoupper(substr($Content,-5)) == '.HTML') { This does not change the title displayed in the list and uses only the original HTML filename. It takes only one or two lines of code to extract the title from the HTML document.
  11. euc

    apache version for php

    Apache comes first because PHP is a module that Apache loads into itself. The Apache documentation doesn't say much about PHP or any other server side script, if anything. On the Apache version I am running at present I have run a couple of PHP versions so there is some overlap. .
  12. Learn PHP or some other server side scripting. I don't know of a web host that doesn't support it. All you would have to do is upload all your content one file at a time into a folder and get the PHP script to run through that folder to generate your list items for you. If you are really interested, reply to this post and I'll write you a short bit of PHP code to accomplish this. All you should have to do is just throw it into the page you already have.
  13. euc

    php and plus sign spacing

    Another way:- echo $string1 , ' ' . $string2; or echo $string1 , ' ' . $string2; // put in one space using this method you can make it as many spaces as you want eg echo $string1 , ' ' . $string2; //this will put in 3 spaces and echo $string1 , ' ' . $string2; //will put in 5
  14. I am an old fella (65 years old) and have been programming computers since 1968 in assembly language (still do) fortran, basic, apl, pascal, modula (similar to pascal), and C (which is why I like PHP). I did learn Java as well but find it the most pedantic, restrictive, inefficient waffle I have ever encountered. The same for Javascript which is why 99% of the web pages I write have none at all although there are occasions where I can't avoid it. I write everything by hand using notepad and therefore have an APACHE server and PHP installed on my computer. It's nice they are both free. Thank you Apache and PHP. I joined because I thought it was about time I helped a bit because there are quite a few programmers out there who shouldn't be allowed near a computer in case they trip over and hurt themselves. W3C recommendations and specifications are great so it's a pity many are ignored on some platforms, like Android, by some browsers and even by W3C itself on rare occasions.
  • Create New...