I am getting a \n before the text in the following code. Is there some PHP option that would be doing this?
<?php require_once('Connections/test_connect.php'); ?>
<?php
$v=$_GET['vendorID'];
$c=$_GET['catID'];
mysql_select_db($database_test_connect, $test_connect);
$query_rs = "SELECT * FROM lnkcategoryvendor WHERE vendorID=$v AND catID=$c";
$rs = mysql_query($query_rs, $test_connect) or die(mysql_error());
$row_rs = mysql_fetch_assoc($rs);
$totalRows_rs = mysql_num_rows($rs);
if($totalRows_rs!=0) {
echo 'hit';
}
else {
echo 'nohit';
}
?>
TIA
Getting a NL before text in 'echo'
Moderator: General Moderators
Re: Getting a NL before text in 'echo'
Why do you have two PHP code blocks?
And yes, the space between them is what's causing the newline.
And yes, the space between them is what's causing the newline.
Re: Getting a NL before text in 'echo'
Interesting....
The double "PHP's" are because I copied this from a Dreamweaver generated page and didn't really spend any time analyzing it.
Thanks
The double "PHP's" are because I copied this from a Dreamweaver generated page and didn't really spend any time analyzing it.
Thanks
Re: Getting a NL before text in 'echo'
Dreamweaver? Bah! 
Re: Getting a NL before text in 'echo'
No Dreamweaver? Then do you use any other designer? Or, just hand code?
Also, while I'm at it, in a few cases I have done the following:
$vendorID = $_GET['vendorID'];
What is the PHP option that automatically defines the above; i.e., automatically lets you use the "$_GET" parameter as a variable?
TIA
Also, while I'm at it, in a few cases I have done the following:
$vendorID = $_GET['vendorID'];
What is the PHP option that automatically defines the above; i.e., automatically lets you use the "$_GET" parameter as a variable?
TIA
Re: Getting a NL before text in 'echo'
1) I hand-code everything. It's much more satisfying. 
2) That's register_globals, but don't use it. It's a massive security vulnerability if you don't code everything well. It isn't even very useful.
2) That's register_globals, but don't use it. It's a massive security vulnerability if you don't code everything well. It isn't even very useful.
Re: Getting a NL before text in 'echo'
Thanks for all of your input...
It's much appreciated.
It's much appreciated.