Jump to content

BrainPill

Members
  • Posts

    123
  • Joined

  • Last visited

Posts posted by BrainPill

  1. Until now I worked mainly with wamp. I am looking for setting up a good server online, other than wamp. Most likely it will be Managed VPS.

    Having full control I would like to choose the right admin software. Plesk, Cpanel or Webmin.

    But the most important thing I would take into account is which admin software is best for managing htaccess/mod_rewrite ?

    Is there a GUI built in Plesk, Cpanel or Webmin? Or is there additional software in specific Linux distributions?

    I would like to receive some info or valuable links online to read if possible ?

     

  2. I have quite a challenge for php + mysql query I would like to solve. 

    I want to add a row to the database table, but this entry should be done only every 10 minutes;

    I want mysql to handle this with date_add(now() interval.

     

     snippet of the code:

    $stmt = $conn->prepare("INSERT INTO test.test_tab
    		(uid, email, col) VALUES (?, ?, ?, date_add(now(), interval 5 MINUTE)  )
    		 ;
    		");
    		
    		$stmt->bind_param("sss", 
    		$uid, $email_f , $col );
     
    		$stmt->execute();

    the browser output gives a call to a member function bind_param error

    What is the best way to add a row every 5 minutes while using php ? Can someone help me out?

     

  3.  

    Is it possible to see the PHP errors and notices from someone else's site?

    I saw a website online giving me loads of PHP errors, but I always understood it was only possible for the people running the server to see the PHP errors.

    Is there another way to show the PHP errors?

  4.  

    I work localhost wamp windows 10 with the DIVI builder in Wordpress . 

    Regardless of whether the colors are adjusted with the customized menu or the visual page builder module; the colors are not visible when logged out.
     
    Other layout changes are visible. (height / width)
    I tested all the web browser and cleared the cache.

    WAMP apache has rules for caching, but does a caching plugin within WP affect the colors?

  5. Hi all

    I have an uncommon problem I cant really solve . 

    I have a script that uses require and calls for a new php script.

    If I comment the line and check what happens in the browser then I have different results .

    Chrome and Edge: nothing happens, the old require routine is executed; even after clearing browser cache in Chrome.

    In the Brave Browser is the commented require line not executed and is shown nothing in the browser.

     

    Does this mean that there is also a server cache and should I empty it? If so then how should it be made empty?

     

  6. On 3/4/2020 at 2:44 PM, dsonesuk said:

    You only use this once at beginning of htaccess file

    RewriteEngine On

    then

    RewriteBase /

    The above determines what directory the following mod rewrites will be working to

     

    Is it possible to still execute the $_GET php code and have a clean url ?

     

    I find it EXTREMELY hard to solve my problem written in the OP.

  7. Ok well I removed the code but this did not give any other result.

    I use $_GET to process a variable. 

    When I test this in an html form I see the output I want.

    When I use $_GET in the same script but with a link it does not work.

    (btw you say that using RewriteEngine On and RewriteBase / in this way is not needed, but it worked in the form script for me)

    Is there a reason that apache processes this different and how can I change these settings?

  8.  

    I have a htaccess file. The first lines (#preceding code) work well
    From #problem code I get problems.

    The idea is a php menu set up (simulation) with an < a href ""> link
    where all the query code is sent back to the page while the URL
    only shows the index6 (as a directory) 
    This worked while using a form with $_GET

    But for the a href link it does not work properly what happens is that the $_GET input is not
    parsed by PHP anymore. The URL though stays 'clean' or 'tidy' or whatever; in any case without 
    the query part.

     

    index6.php page:

    <?php
    //var_dump($_SERVER);
    
    var_dump($_SERVER['HTTP_HOST']);
    
    
    ?>
    <html>
    <body style=" ">
    <div style="margin-left: 600px; margin-top: 200px; width: 800px; height: 400px; border: 2px solid brown;">
    <br><br>
    
    <p style="font-size: 20px;">
    TEST
    </p><br><br>
    Index page. Execute at a virtual (test) host 
    <br><br>
     
    <br><br>
    <a href="http://<?php echo $_SERVER['HTTP_HOST'] ?>/index6.php?mvalu=home">Home</a>
    
    <?php 
    
    if(isset($_GET['mvalu'])) {
    	
    	var_dump($_GET['mvalu']);
    	
    }
    
    ?>
    </div>
    </body>
    </html>

     

    the .htaccess file

     

    ##################
    # preceding code 
    
    RewriteEngine On
    RewriteCond %{THE_REQUEST} /([^.]+)\.php [NC]
    RewriteRule ^ /%1 [NC,L,R]
    
     
    
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)/$ /$1 [R=301,L]
    
    #######################################
    # problem code from here :
     
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} ^/index6.php [NC]
    RewriteCond %{QUERY_STRING} \bmvalu=home\b [NC]
    RewriteRule ^index6\.php$ /index6/%1/? [NC,R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^index6/(\bmvalu=home\b)/?$ /index6.php/$1 [QSA,L]
    
    
    

     

    I hope someone here can help me with solving how to get a tidy url and processing the $_GET data correct.

     

     

  9. 13 hours ago, dsonesuk said:

    I have this direction placed in the vhosts file

     

     Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All
     	   Require all granted

    Could it be any other script that still overrides this ? I tried the same ones in the httpd.conf file but I am not sure how to do it. 

    Is the httpd directive more determining for instance ?

    What else could it be? 

     

  10. I have a question about apache.

    I have WAMP version 3.1.9

    apache 2.4.39

    I want to remove the *.php extension in the url

    in the .htaccess file which I placed in the directory ; I added the following code

     
     RemoveType *.php

    but still when going to a page I see the php extension

    in the apache pages I read that the loaded module should be mod_mime 

    https://httpd.apache.org/docs/2.4/mod/mod_mime.html#removetype

    (i can see its loaded when checking php_info() ) 

    still I dont have any result. 

    What more directives are needed?

    Or is there another approach for removing file extensions?

     

  11. Hello I found an online example of radio buttons its in html css.

    (example can be foud at codepen too https://codepen.io/web-tiki/pen/JXwLGQ/   ) 

    I would like to get the chosen value into php

    the script is without javascript jquery.

    Do I need this to solve it? (If not needed then rather straight from html to php )

    And if needed javascript or jquery, how is it done?

     

    <html>
    
    <head>
     <style type="text/css">
     *{margin:0;padding:0;box-sizing:border-box;}
    body{background:teal;color:#fff;padding-bottom:10%;}
    h1{text-align:center;margin:20% 0 5%;font-family:verdana;font-weight:100;}
    #radios{
      position:relative;
      width:50%;
      margin:0 auto;
    }
    input[type="radio"]{
      position:absolute;
      right:1000%;
    }
    label{
      float:left;
      width:15%; padding-bottom:15%;
      margin:0 2.5%;
      background:rgba(255,255,255,.2);
      border-radius:50%;
      cursor:pointer;
    }
    #slider{
      position:absolute;
      left:0%; top:0;
      width:10%; padding-bottom:10%;
      margin:2.5% 0 0 5%;
      background:#fff;
      transition:transform 1s;
      border-radius:50%;
      animation-timing-function: ease-in-out;
      animation-duration:.3s;
      animation-fill-mode: forwards;
      transition: 0.2s left .05s ease-in-out;
    }
    #input1:checked  ~ #slider{ animation-name: input1; left:0; }
    #input2:checked  ~ #slider{ animation-name: input2; left:20%; }
    #input3:checked  ~ #slider{ animation-name: input3; left:40%; }
    #input4:checked  ~ #slider{ animation-name: input4; left:60%; }
    #input5:checked  ~ #slider{ animation-name: input5; left:80%; }
    
    @keyframes input1{ 30%, 70% { transform:scale(0.5); } }
    @keyframes input2{ 30%, 70% { transform:scale(0.5); } }
    @keyframes input3{ 30%, 70% { transform:scale(0.5); } }
    @keyframes input4{ 30%, 70% { transform:scale(0.5); } }
    @keyframes input5{ 30%, 70% { transform:scale(0.5); } }
     </style>
    </head>
    
    <body><center>
    <br><br><br><br>
    <form action="" method="post" onChange="this.form.submit();" >
    <h1>Select one:</h1>
    <div id="radios">
      <label for="input1"></label>
      <input  id="input1" name="radio" type="radio" />
      <label for="input2"></label>
      <input  id="input2" name="radio" type="radio" />
      <label for="input3"></label>
      <input  id="input3" name="radio" type="radio" />
      <label for="input4"></label>
      <input  id="input4" name="radio" type="radio" />
      <label for="input5"></label>
      <input  id="input5" name="radio" type="radio" />
      <span id="slider"></span>
    </div>
    
     
     
    </form>
    <?php 
    if(isset($_POST['radio'])) {
    	
    
    	var_dump($_POST['radio']);
    }
    
    
    
    ?>
    </center>
    </body>
    </html>

     

    Anyone got any idea?

  12. On 1/21/2020 at 12:39 PM, niche said:

    what happens when you add a path? 

    I tried that. Are there specific rules I should follow? 

    What actually happens when you call a php shell_exec command? Where will the command look to start something? 

    --------------------------------------------------------

    Edit: I tried the following

     

    
    $var = php_sapi_name();
    var_dump($var);

    the output is: apache2handler

    In the manual of php is a number of outputs mentioned 

    Quote

    aolserver, apache, apache2filter, apache2handler, caudium, cgi (until PHP 5.3), cgi-fcgi, cli, cli-server, continuity, embed, fpm-fcgi, isapi, litespeed, milter, nsapi, phpdbg, phttpd, pi3web, roxen, thttpd, tux, and webjames.

    https://www.php.net/manual/en/function.php-sapi-name.php

     

    I dont know if this is the solution but it coudl be so does anyone know if the sapi can be set to cli or cli-server maybe?

     

  13. I have a complicated situation

    I want to execute a php script that runs in the background while a browser script is used as trigger.

     

    I use wamp CLI to execute a php script like this:

     

    php test.php

     

     

    I want to execute this script in the browser with this script

     

    $outp = shell_exec("php test.php");
    
    
    echo '<br>';
    echo $outp;
    echo '<br>';

     

    It doesnt work. The page in the browser is giving no output

    I can do shell_exec("whoami"), or shell_exec('dir'); So this works, but executing a script not.

     

    What causes this error?

     

     

     

×
×
  • Create New...