• good afternoon I have a form q makes a search with Zillow’s API which returns me the amount and captured in another form which send user data, sending the second form I get error 404 not understand why it comes out if the first form I sent, I am using the post method in index.php

    Here the code

    <?php if(isset($_POST['search'])){ 
    
    		define ('HOSTNAME', 'http://www.zillow.com/webservice/GetSearchResults.htm?');
    
    		// Get the REST call path from the AJAX application
    		// Is it a POST or a GET?
    
    	$path = "zws-id=".$_POST['zws-id']."&address=".urlencode($_POST['address'])."&citystatezip=".urlencode($_POST['citystatezip']);
    
    		//echo $path;
    		$url = HOSTNAME.$path;
    
    		//echo $xml;
    		$xml = simplexml_load_file($url);
    
    		if(isset($_POST['send'])){
    
    		wp_redirect("http://www.xxxxxxxxx");
    
    		}else{
    
    		?>
    
            <form  method="POST" action="">        
    
            <table align="center">
    
            <tr>
    
            <td align="right" class="screen-reader-text" for="name">Name :</td>
    
            <td>
            <input type="hidden" name="monto" value="<?php echo $xml->response->results->result->zestimate->amount; ?>" />
    
            <input type="text" name="name"  value="" /></td>
    
            </tr>
    
            <tr>
    
            <td align="right" class="screen-reader-text" for="email">Email :</td>
    
            <td><input type="text" name="email"  value="" /></td>
    
            </tr>
    
            <tr>
    
            <td align="right" class="screen-reader-text" for="cmort">Current Mortgage Balance :</td>
    
            <td><input type="text" name="cmort" value="" /></td>
    
            </tr>
    
            </table>
    
            <input type="submit" name="send"  value="Send"  class="button"/>
    
            </form>
    
            <?php } }else{ ?>
    
            <span><a href="">Is Short Sale Your Best Option? To find out more click to see video</a></span><br /><br />
    
            <form  method="POST" action="">        
    
            <table align="center">
    
            <tr>
    
            <td align="right" class="screen-reader-text" for="address">Address :</td>
    
            <td>
            <input type="hidden" name="zws-id"  value="xxxxxxxxxxxx" />
    
            <input type="text" name="address"  value="" /></td>
    
            </tr>
    
            <tr>
    
            <td align="right" class="screen-reader-text" for="citystatezip">City State Zip :</td>
    
            <td><input type="text" name="citystatezip"  value="" /></td>
    
            </tr>
    
            </table>
    
            <input type="submit" name="search"  value="Search"  class="button"/>
    
            </form>
    
            <?php } ?>

    I hope you can help me with my problem know which is my mistake

  • The topic ‘$ _POST Not work’ is closed to new replies.