Re: Does HTACCESS block $_POST ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



FORM:- (uses w3css - been using w3css for years...


<form class="w3-container" action="/vyb/" method="post">

<select class="w3-select w3-select" name="viewaddress"
onchange="this.form.submit()">
<option value="">Home/main office</option>
<option value="909-2-2" >(909-2-2) 88 Newland St, Bondi Junction NSW
2022</option>
</select>

<br /><br />
<select class="w3-select w3-yellow" name="CHANGEURL">
<option value="/vyb/">no action specified - select an action</option>
<option value="/vyb/desc" >update business/location description</option>
</select>
<select class="w3-select w3-yellow" name="DISPLAY">
<optgroup label="FUNCTIONS NOT GOING YET">
<option value="ACTIONupdatestatus" >Update your business status</option>
<option value="ACTIONMAIL" >Change frequency of emails</option>
<optgroup label="Description">
<option value="ACTIONmodifydescription" >Modify business/location
description</option>
<optgroup label="Services">
<option value="ACTIONviewservice" >View Services</option>
<option value="ACTIONaddservice" >Add a Service</option>
<option value="ACTIONremoveaservice" >Remove a Service</option>
</select>

<p><button class="w3-btn w3-teal">View Location</button></p>
</form>



HTACCESS:

Options +FollowSymLinks
RewriteEngine On

RewriteRule ^(.*)$ vyb6a.php   [QSA,L]


END HTACCESS

top few lines of my php script - vyb6a.php



<?php

$xa=print_r($_POST,true);
$va="BLUE\n$xa\n";
 //echo "<pre>$va</pre>\n";


include_once("../../includes/initial.inc.php");
include_once("V03/vybMODV03_job_modify.inc.php");
include_once("V03/vybMODV03_mail_update.inc.php");
include_once("V03/vybMODV03_cookies.inc.php");
include_once("V03/vybMODV03_get_inputs.inc.php");
include_once("V03/vybMODV03_log_helpers.inc.php");
ini_set("precision", "16");

$re=$template_data['viewaddress'];
$va.="VA 1abr '$re' \n$xa\n";

echo "<pre>$va</pre>\n";


NOTE - if I un-comment the 1st echo, NOTHING is displayed on screen..

the script works perfectly fine & all the included files work (based
on login & URL) - im just adding my next stage - submitting data...


Gordon




On Mon, 21 Apr 2025 at 16:05, JEFFRY KILLEN <jekillen@xxxxxxxxxxx> wrote:
>
> A quick checklist:
>
> 1: is the form submitting the values set to POST or GET?
> 2: do the form fields have NAMES? They have to have names to
>    be sent so you get $_POST['form field name']: ['form field value']'
> 3: CHECK in the script that is supposed to process the $_POST
>     index/values is receiving the $_POST
> if(isset($_POST)
>  {
>   // test for a specific field
>  if(isset($_POST['testfield']))
>   {
>    // proceed with processing
>   }
> }
> else if(isset($_GET)
>  {
>   // test for a specific field
>  if(isset($_GET['testfield']))
>   {
>    // proceed with processing
>   }
> }
>
> I find that with recent versions of PHP that
> if($_POST) //or if($_GET)
> does not necessarily work
>
> Also are the values being submitted synchronously or asynchronously?
>
> I hope you do not feel insulted by this.
> I have subjected myself to this in my debugging mostly to
> benefit. Your form may have changed or some other issue
> has crept in that is obvious when you see it, but hard to spot.
>
> Work On....
> JK



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux