Jump to content

AlexC

Members
  • Posts

    16
  • Joined

  • Last visited

Posts posted by AlexC

  1. Thanks for everyone's suggestions, but I'm giving up on this for the present. I've tried numerous variations in my code and nothing seems to work. When I have cut and pasted my very basic code into the W3schools 'try it' pages (which I used as the basis in the first place), sometimes it works and sometimes it doesn't. It would have been nice if it worked, but plenty of other things to do.

  2. Haven't tried your latest suggestion with the JavaScript, but did try a simple window.open. Nothing happened. So went back to the simple 'try it' examples in W3Schools and substituted my link - all OK. The difference to the W3S example is that I am trying to activate the link from a list item in a drop down menu and the W3S example is via a button.

    So either this is not possible or my construct is way off, First tried,

     

    <li><a onclick="NewWindow()">Test LINK</a><li>

     

    having just substituted the onclick for the original href and having put the href link into the NewWindon function. No result.

    Then tried the onclick within the <li>, taking out the <a></a>. No result.

    Then tried, out of interest, putting a button in place of the <a></a> construct. No result.

    The only affect of the last two was to muck up the formatting of the menu for that item.

    So then tried putting the original href back and adding the onclick within the <a></a> and then the <li>. No result.

    So if it is possible to get an onclick event into a menu item structured with a series of unordered lists, what's the syntax?

     

    Thanks.

  3. Yes, easy of use is the problem. For the post 60 generation, with which I am dealing, when information disappears there is a tendency to think that it is not available rather than not visible. The current modes of operation used on the web are not obvious to a lot of older people and as soon as they manage to learn some they have a habit of changing.

    Currently they click on a link to create a working page, which has to run on a different server, and loads in a new tab. When wanting to return to the original page, they seem to use the tab OK, but when trying to get back to the working page, they click on the link again in the original page to get back to the working area, rather than just the tab, which just sends them through a new start up loop and creates another tab. Opening a new window might make it more obvious that the two pages co-exist and also allows easier cross-reference between the data in the two pages. I could just stay in the original tab, but that creates a completely different set of usability issues. No perfect solutions.

  4. Using target="_blank" in <a>..</a> nominally opens a new window. In browsers with a tab facility however it usually opens a new tab. You can usually pick up a tab and move outside the browser window to create a completely new window, but how do you force a completely new window rather than just a new tab f romthe start?

     

    I haven't come up with search criteria that give me anything other than target="_blank".

     

    Thanks

  5. Although I have been using HTML since 1997 to build web pages, I only started to build a 'modern' website with server and browser scripting and databases at the start of 2013 and have been finding W3schools extremely useful in starting to learn Javascript, PHP, CSS, etc. I have had a very steep learning curve in terms of security and got caught out by an add on which I didn't know I had downloaded until I used a screen recorder to experiment with making a tutorial video. I started the recording session fine by selecting the window I wanted to record - the home page of a website - and then suddenly my title line changed, with the significant words becoming a different font and colour, underlined and with links and an advertisement banner appeared at the bottom of the page. No other pages or websites suffered from the problem, nor did this page if I used another computer, so it was obviously linked to the screen recorder and this particular computer. I looked at the source code of the page (in the browser) and that had not apparently been altered and the URL was still showing as normal. I tracked it down to a SuperLyric addon and a bit of searching suggests there are quite a few of these adware programs around.

     

    The question I have is, given that the source code in the browser seemed to be unchanged and the URL unchanged, what is the mechanism by which my home page was altered and is there any technique for preventing this uninvited inclusion of links and ads into a page? I am assuming that it is some form of browser script, hence trying this forum.

     

    As an aside, as I am building this web site for a charity, if anyone knows of a good open source screen recorder without uninvited extras, I would be grateful for the information.

     

     

    Many thanks.

  6. That's part of the problem - I'm not seeing any error returns at all. I see one echo, with the sqli_error, after the problem query statement and that's it. As far as I can see there is still a lot of valid HTML output that should come out on further echoes but if you view the source code in the browser there is just nothing else after the sqli_error echo, not even the closing Body and HTML tags.

  7. Tried adding mysqli_error() and could not get any errors reported. I did add some code to simulate a successful query and the other three queries in the code worked fine. So I tried pasting in one of the $result = mysqli_query($dbAcon,$query) statements that worked for the other queries with no progress. The query causing the problem did have a join in it, but as I said, had been working fine. I was going to split the query to take out the join for other reasons, so I thought I'd try that as I was planning to run a demo on Tuesday and it is now working. I then did a quick survey of my other pages and found that the only places where I use joins I have created views in the database first. That's the only difference I can see. Although why it should work and then not work.... So I have a solution, but not a satisfactory reason for the failure.

     

    many thanks for answering.

  8. As the query works fine in phpMyAdmin or MySQL workbench, I am assuming at present it is a php problem. I have the following code being used to uniquely identify a person from a form entry,

     

     

    if (mysqli_connect_errno($condb))

    {

    echo 'Failed to connect to MySQL: ' . mysqli_connect_error();

    }

    else {echo 'connected';} //****debug 1

     

    $firstname = preg_replace('/[^a-zA-Zs]/', '', $_POST['idfirstname'] );

    $lastname = preg_replace('/[^a-zA-Zs]/', '', $_POST['idlastname'] );

    $streetno = preg_replace('/[^0-9s]/', '', $_POST['idhouseno'] );

    $telephone = preg_replace('/[^0-9s]/', '', $_POST['idtelephone'] );

     

    // echo '<br>'.$firstname.', '.$lastname.', '.$streetno.', '.$telephone; //****debug 2

     

    $query="SELECT .....;";

    echo '<br><b>Query for user id:</b> <br>'.$query; //****debug 3

    $result = mysqli_query($condb,$query);

    $count = mysqli_num_rows($result);

    echo '<br><b> row count:</b>'.$count.' - result: '.$result. '!'; //****debug 4

    // --------------------------------------------------------------------------------------------------------------

    // Check for unique data

    /* if($count == 1) {

    // unique ID successfull

    while($row = mysqli_fetch_array($resultA))

    { ......

     

    Code was working fine this morning and I was refining the code further on and adding other extraction options in new pages based on having a unique identification. However it has suddenly stopped working. Other parts of the site, not relying on this identification are working fine. Debug point 1 comes up fine as 'connected', the data at debug 2 is fine and if I cut and paste the query output in the browser from debug point 3 into phpMyAdmin or mySQL workbench, no problems, I get the results expected. However debug point 4 does not materialise. If I comment out the line $result = mysqli_query($condb,$query); debug 4 comes up, but obviously not with any results. I'm using Aptana workbench and that is not flagging any syntax errors. I have tried rewriting the line and cut and pasted a similar mysqli_query line from other pages where it is working in case a funny character had got into the code, but to no effect. As I have lots of other similar code instances still working fine, this is causing some frustration. Any ideas on what I am hoping is an obvious error that I just can't see, very much appreciated.

     

     

     

     

  9. Many thanks for your help. I'm now getting a response to the resize event, although a resizeend event doesn't seem to work but that isn't a serious limitation. However I'm not getting the overall result I wanted, but I think I know why - I need to significantly extend my scripting but having just started on scripting, PHP, CSS, etc. I need to get more familiar with all those I think before returning to this.

  10. Thanks for the reply - been out for a few days, hence the delay in trying it. However parentheses have not made a difference. I also imported the relevant lines of one of the W3Schools' code examples for resizing into my page, as below, but that doesn't produce any results either, so there must be something basic I'm missing. I'm currently in IE10 on Windows 8, but I've also tried it in Firefox and Chrome.

    <!DOCTYPE html><html><head><script>function showMsg(){alert("You have changed the size of the browser window!");}</script></head><body onresize="showMsg()"><p>Try to resize the browser window.</p></body></html>

  11. I am using <iframe> to create a scrollable area in the remaining space in a window. I have a small java script to calculate the size of the frame and that works fine. If I resize the window and then force a refresh everything works no problem. To avoid confusion for the user by having two scroll bars if the window is resized I then thought of using the onresizeend event to trigger a script to do the reload. So far no success. The function I have created is,

    function resizeframe {document.location.reload("true");}

    I don't know whether the function is wrong or I have not placed the trigger in the correct place. I have tried the trigger on the <div> for the <iframe> creation and then successively higher until placing in the <body> - all with no result. I have also tried adding a 'contenteditable' attribute to the <iframe> <div> with no result. Any pointers would be appreciated.

  12. This looked like the most likely forum to start with for this problem; apologies if it is not. Although I have done some serious programming in the past, it was mainly Fortran (with some DCL while acting as a VAX VMS system manager) and in the last ten years or so ABAP and VBA, I am a complete novice in web scripting. I do maintain three very simple web sites, but they are just HTML. I now wish to expand the functionality of my websites with both browser and server scripting. I am starting to make progress with the browser scripting but I have a fundamental problem with the server scripting. I am currently running the websites on the free web space provided by my ISP. There is no documentation provided for this facility other than giving the FTP upload details. In fact I can not see any evidence in their current broadband offering that they even offer webspace. My previous communications with the support desk gives me no confidence that they will understand any questions I might ask about scripting, let alone be able to answer them. Since at present I am unlikely to get my scripts correct, I do not know whether it is my problem or the server is simply not supporting any scripting. Is there any simple known working code that I can use to verify which scripting language might be supported on a server? Many thanks.

×
×
  • Create New...