Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter nhoa88

    (@nhoa88)

    I have put $_GET first and it keeps the value of that parameter.
    It works this way:

    [insert_php]
    $_GET['parameter1']='myValue';
    include("./myFolder/myFile.php");
    [/insert_php]

    ??

    nhoa88

    (@nhoa88)

    I have a connection with a database in my file. I use this way:

    In WP page use this:

    [insert_php]
    include("./myFile.php");
    [/insert_php]

    And then the connection in the file is:

    <!DOCTYPE HTML>
    <html>
    <head>
    	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    	<title>Estación</title>
    
    </head>
    <body>
       <?php
           // Database connection
                $con = new mysqli("server_ip","username","password","database_name");
                // Query
                $stmt = $con->stmt_init();
                $stmt->prepare('SELECT col1,col2 FROM table_name');
                if(!$stmt->execute()){
                    throw new Exception('No se pudo realizar la consulta:' . $stmt->error);
                }
                else{
                    $stmt->store_result();
                    $number_rows = $stmt->num_rows;
                    if($number_rows>0){
                        $stmt->bind_result($col1,$col2);
                         while($stmt->fetch()){
                              echo('Colum1: '.$col1);
                              echo('Colum2: '.$col2);
                         }
                    }
                }
                $stmt->close();
        ?>
    
             <!-- MORE TO DO HERE, WHAT YOU WANT -->
    
    	</body>
    </html>

    I hope this could help you! Good luck!

    Thread Starter nhoa88

    (@nhoa88)

    Resolved! The problem was that my JS file was interpreting wrong. I don’t know if it was because of the plugin or what but it was addding ‘</p>’ in blank spaces.

    Thanks for the help Will!

    Thread Starter nhoa88

    (@nhoa88)

    I have tried also with another example that I have that it doesn’t use CSS files, it use 3 JS files.

    So, with this new example:

    I don’t understand very well why it is not enough if I put this code inside the php that I’m including in the wordpress page.

    This is what I have inside the php.

    <script src="./highcharts.js"></script>
    <script src="./highcharts-more.js"></script>
    <script src="./data.js"></script>

    But i have tried what you say. Removing these three line in the php and put this way in the page.

    <script src="/highcharts.js"></script><script src="/highcharts-more.js"></script><script src="/data.js"></script>
    [insert_php]
    include("myFileName.php");
    [/insert_php]

    (Also I have tried with the full URL but nothing)

    ?? I guess that you have used this kind of examples with your plugin, no?? I mean, a php including javascript funcionality.

    Thank you!!

    Thread Starter nhoa88

    (@nhoa88)

    Thank you for your reply Will.

    I have already tried that, but it doesn’t work. I’m sure that my CSS and JS files works because if i try them outside wordpress it works.

    The problem is that I don’t know where I have to put these files to work.

    Could anyone help me please?

    Thread Starter nhoa88

    (@nhoa88)

    So, as you say Will, I put this way:

    <script src=”./jquery.js”></script><script src=”./jquery.dataTables.js”></script><link rel=’stylesheet’ type=’text/css’ link=”./jquery.dataTables.css.css”>[insert_php]
    include(“myFileName.php”);
    [/insert_php]

    Buit it doesn’t work ??

Viewing 6 replies - 1 through 6 (of 6 total)