Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

About BrainPill

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. 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.
  2. 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?
  3. 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.
  4. 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?
  5. I tried to put this in the htaccess file AllowOverride All RewriteEngine On RewriteRule ^([^\.]+)$ $1.php [NC,L] But this makes the request crash the apache error logs tells: Why is this error showing up?
  6. it is enabled. I can see it in php_info() in the list under apache2handler : loaded modules Other directives do work in the .htaccess file, but this one doesn't. Are there additional requirements?
  7. 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?
  8. 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?
  9. It still does not work for me. What I tried is this: $output = shell_exec("A:/wamp64/test/batchscripts/hello_world.php"); echo '<br>'; echo $output; echo '<br>';
  10. Or should I change the php.ini settings? I figured out I have (at least) 2 different php.ini files. One in the apache dir and 1 in the php dir
  11. 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 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?
  12. 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?
  13. Do I have to set a path or so for the Command Line Interface , PHP_CLI ? If so, how should this be done? EDIT: as there are many OS and approaches of PHP I have some additional info about my set up. I use WAMP 3.1.9 with windows 10. PHP version 7.3.5
  • Create New...