User Profile

Collapse

Profile Sidebar

Collapse
Claus Mygind
Claus Mygind
Last Activity: May 15 '17, 06:57 PM
Joined: Mar 25 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Claus Mygind
    replied to php sees html input as a code
    in PHP
    Ok first a few minor errors in your code, but since it is just an example that does not really matter.

    Exploitation of your code is not possible when the page is streamed out, because the periods and other PHP command codes you insert in your page are not streamed out to the client machine.

    From your example
    Code:
     <?php
     
    $test = $_POST['test']; 
     
    echo 'You wrote '.$test.'!'; 
     
    ?>
    ...
    See more | Go to post

    Leave a comment:


  • Claus Mygind
    replied to php sees html input as a code
    in PHP
    Most likely you are not separating your php code from your html code. But there really is no way to answer your question because you did not show us your code. Would like to have been of more help.
    See more | Go to post

    Leave a comment:


  • Claus Mygind
    replied to How To Retrieve Data After Login
    in PHP
    I will point out your errors below, but first.
    1. When posting question use the [CODE/] around your code it makes it easier for other people to read your code.

    2. Use indents in your code also to make it easier to read. People are less likely to help if they cannot easily read your code.

    3. You should stop using mysql and switch to either mysqli or pdo. To change this you need to enable these modules in your...
    See more | Go to post
    Last edited by Claus Mygind; Dec 21 '15, 04:45 PM. Reason: additional errors found in original code

    Leave a comment:


  • I resolved my issue and thought it best not to leave this question hanging in case others are wondering the same.

    What you're seeing is a result of the escape sequence \e, which is the ESC character (0x1B (27) in ASCII). This was added in PHP 5.4.4, which explains the difference between versions. This only occurs with that exact character sequence ("\e"), which explains why the other paths work fine.

    Also,...
    See more | Go to post

    Leave a comment:


  • Full path for include files (differences between 5.3 and 5.6)

    In upgrading our system from PHP v 5.3.3 to 5.6.x on a apache 2.4.18 server running on Windows 7, we ran into a problem with include files.

    We were using full path for our includes i.e.
    Code:
    include("c:\webSpace\Library\[B]e[/B]mployee.php")
    This ran just fine in v5.3.3 But in newer versions 5.6 and 7, file names that started with an "e" were escaped so it was transmitted like this:
    Code:
    include(c:
    ...
    See more | Go to post

  • Claus Mygind
    replied to user restriction (PHP, MYSQL,HTML)
    in PHP
    From your description, I cannot tell what webserver you are using ie: Apache, MSSQL etc.

    One way would be to give each user separate code to execute, which would be authenticated by the web server with their login id.

    A second way If you are using a user login into the MySQL data base, you can use Schema Object Privileges. Using this approach you can exactly specify what a user is allowed to do.

    But if it just...
    See more | Go to post

    Leave a comment:


  • Claus Mygind
    replied to How to compare 2 variables
    in PHP
    Never mind. Have to be careful when looking at spaces they get condensed in the output

    A simple str_replace command showed the difference
    Code:
    		$Rval = str_replace(" ", "/", $rKey);
    		$Cval = str_replace(" ", "/", $cKey);
    and the result when the spaces were replaced with the slashes
    looked like this

    rType=83217/////1680
    cType=83217////1680...
    See more | Go to post

    Leave a comment:


  • Claus Mygind
    started a topic How to compare 2 variables
    in PHP

    How to compare 2 variables

    I seem to be stuck on comparing two variables. Everything I have tried appears to say they are equal, but the If condition returns false every time.

    Here is the problematic code
    Code:
    $cBoring    = str_pad(trim($this->r[$key]["BORING"]),5,' ',STR_PAD_LEFT);
    
    $cContainer = str_pad(trim($this->r[$key]["CONTNUMB"]),3,' ',STR_PAD_LEFT);
    
    $cKey = $this->r[$key]["JOBID"]
    ...
    See more | Go to post

  • go it figured out

    made a change to the config file on the webserver for that specific directory.

    require ip my.ip.address
    See more | Go to post

    Leave a comment:


  • go it figured out

    require ip my.ip.address
    See more | Go to post

    Leave a comment:


  • How to configure one directory which would not require user & password

    I have authentication setup which require authorized users and passwords. Now I need to add a directory, in which the user is not presented with the login request.

    The reason for this is I have a Chrome App in our lab which cannot contain that request (because I don't know how to add it to the Chrome App).

    I saw an example (but cannot find it again) where a separate directory was added to the Apache config file which...
    See more | Go to post

  • Claus Mygind
    started a topic Adding login request to a Chrome App

    Adding login request to a Chrome App

    I'm developing a Chrome App (previously called packaged app)

    In the manifest.json file I've add the permissions to access remote servers.
    Code:
    "permissions": [
           "fullscreen",
           "serial",
        [B]"http://*/",
           "https://*/"[/B], 
           "identity"  
    ]
    And it works great when retrieving...
    See more | Go to post

  • Can't give you an answer to question #1, code looks too confusing. Perhaps you need to add an "order by" clause to your sql query.

    Answer to qeustion #2
    You appear to only be inserting data into your table. I don't see an update or delete of existing rows in the table. That could explain why you keep building the number of rows you output

    Answer to question #3

    Your SQL is incorrectly...
    See more | Go to post

    Leave a comment:


  • How to insert a PHP array into a javaScript array

    I was looking for a simple way to create a javaScript array when streaming out my php code.

    my php sql query generates a quick rowset result in an associative array like this.
    Code:
    if ( $result = $db->query($sql) )
    {
      if ($result->num_rows > 0)
      {
        $f = mysqli_fetch_all( $result, $resulttype = MYSQLI_ASSOC );
      }
    }
    Then when streaming out the page,...
    See more | Go to post

  • Claus Mygind
    replied to Extract number from string with RegExp
    in Java
    Not pretty, but at least this seems to work fine

    In the replace method below all characters not matching 0 to 9 or . are stripped from the msg and displayed in my output.
    Code:
    function dispWeight(msg) {
    	document.getElementById("curWeight").innerHTML = msg.replace( /[^.0123456789]/g,"");
    	}
    The RexExps is /[^.0123456789]/g
    The ^ says exclude these characters
    The...
    See more | Go to post
    Last edited by Claus Mygind; Mar 31 '15, 06:29 PM. Reason: Clarification of the example

    Leave a comment:


  • Claus Mygind
    started a topic Extract number from string with RegExp
    in Java

    Extract number from string with RegExp

    I need an example that will extract a decimal number from a string using RegExp

    sample data would look something like this

    "US,GS 0.0 g↵"
    ",GS 164.3 g↵"


    and if no number is found I would want to return false
    "↵"
    See more | Go to post

  • Really!!! this is how you are going to study, by asking other people to do your research. You could just Google the php manual online.

    What other language do you want to put the option list. I suspect you are trying to create a HTML list box.

    By now you should have learned how to drop in and out of php/HTML when streaming out your code.

    1. php runs only on the web server.
    2. HTML and javaScript...
    See more | Go to post

    Leave a comment:


  • Are you trying to write a Java app? If you are, you may want to post this in another forum, because it is not the same as javaScript.

    Also if this is a web app, you may want to use Chrome. It has an (browser-serialport) API that exposes the COM ports on your device, so you don't have to open your self up to the security problems that come along with Java and the special setting you have to create in the browser to use Java.
    ...
    See more | Go to post

    Leave a comment:


  • As I recall this used to be a security issue, so it was generally not permitted as someone could insert code and hijack your info. So to get around that you need to use the keyboard Ctrl-C to copy to the clipboard.

    Maybe things have changed. Check this link http://www.deluxeblogtips.com/2010/0...clipboard.html. You may find other answers out there as well.
    See more | Go to post

    Leave a comment:


  • Hard to help you when you don't show your code.
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...