Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. User input varification

User input varification

Scheduled Pinned Locked Moved Web Development
phpdata-structureshelpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tichaona J
    wrote on last edited by
    #1

    I’ve written code (below) of which receives posted fields data on to the acknowledgement page (Subscribe page > Acknowledge page), however the code is not working as expected so I’ve removed the other code (mainly the sanitizing of user input) and left the code were the users input is checked for empty spaces. This still isn’t working...I’m a rooky, so any help is much appreciated

     if($\_POST\['username'\] === "" ||$\_POST\['userfirstname'\]=== ""|| $\_POST\['usersecondname'\]=== ""||$\_POST\['useremail'\]=== ""||$\_POST\['userpassword'\]=== ""||
    $\_POST\['userpasswordr'\]=== "")
    
    {	
    
    $arr\_fields = array("$\_POST\['username'\]", "$\_POST\['userfirstname'\]", "$\_POST\['usersecondname'\]", "$\_POST\['useremail'\]",
                        "$\_POST\['userpassword'\]", "$\_POST\['userpasswordr'\]");
    
    foreach($arr\_fields as $arr\_field)
    {
    
    	if($arr\_field == "")
    		{
    			$arr\_field = "missing";
    
    		}
    
    }
    
    	$var\_username=			$\_POST\['username'\];
    	$var\_userfirstname=		$\_POST\['userfirstname'\];
    	$var\_usersecondname=		$\_POST\['usersecondname'\];
    	$var\_useremail=			$\_POST\['useremail'\];
    	$var\_userpassword=		$\_POST\['userpassword'\];
    	$var\_userpassword\_repeat= 	$\_POST\['userpasswordr'\];
    	
    	$arr\_fields\_processed = array("$var\_username", "$var\_userfirstname", "$var\_usersecondname", "$var\_useremail",
    					 "$var\_userpassword", "$var\_userpassword\_repeat");
    	
    	header ("location: subscribe.php?arr\_fields\_processed");
    
     } else 
    
    
     	{
    
    	
     	 	//sanitize code...
    	
     	}
    

    :confused:

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups