Jump to content

posting variables after using unset row.


wright67uk

Recommended Posts

Hi im trying to get name, phone, email, webaddress into POST variables, but only my postcode variable is being carried in my url, can anybody help me please?

 

<?php
$subtype = $_GET['subtype'];
$subtype = ucwords (strtolower($subtype));
echo "<h1>$subtype</h1>";

$query = "SELECT name, phone, email, WebAddress, postcode FROM business WHERE subtype ='$subtype' AND confirmed ='Yes' ORDER BY name";
if( $result = mysql_query($query) ) {
echo mysql_error();
while($row = mysql_fetch_assoc($result) ) {
	foreach( $row as $k => $v ) {
		if( empty($v) ) {
			unset($row[$k]);
		}
	}
	if( !empty($row['postcode']) ) {
		$row['postcode_link'] = 
		"<p class=link><a href='/gmap.php?
		phone=" . urlencode($row['phone']) . "
		&email=" . urlencode($row['email']) . "
		&webaddress=" . urlencode($row['webaddress']) . "
		&postcode=" . urlencode($row['postcode']) . "'>Map</a></p><br>";
	}
	echo implode( '<br>', $row);
}
}
?>

Link to comment
https://forums.phpfreaks.com/topic/239690-posting-variables-after-using-unset-row/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.