Jump to content

echo <<<HTML | PLEASE HEEELPPPPP


Recommended Posts

Good day,

I'm having this code here, its a HTML table that is showing up in my PHP page everything works fine but the problem is, It doesn't show any data in the echo section.

PS: There is nothing wrong with my connection string or other stuff, because if I call the variables outside of this table I can see them but I cant see anything inside the table. Should I use any variable encoder or something???????

please HELP

 

>>>>>>>>>PHP CODES<<<<<<<<<<<<<<

mysql_connect("localhost", "admin", "Pass") or die(mysql_error()); 
mysql_select_db("movedb") or die(mysql_error()); 

$find = strtoupper($find); 
$find = strip_tags($find); 
$find = trim ($find); 

$data = mysql_query("SELECT * FROM sheet1sa WHERE upper($field) LIKE'%$find%'"); 

while($result = mysql_fetch_array( $data )) 
{ 

echo <<<HTML
<table width="400" border="0" class="sample">
  <tr>
    <td width="97" rowspan="5"><? echo $F6; ?> </td>
    <td width="125">Name, Lastname</td>
    <td width="164"> <? echo $name; ?> </td>
  </tr>
  <tr>
    <td>Cell Number </td>
    <td> <?php echo $cell; ?> </td>
  </tr>
  <tr>
    <td>Extension Number </td>
    <td> <?php echo $ext; ?> </td>
  </tr>
  <tr>
    <td>Office Number </td>
    <td><?php echo $F2; ?> </td>
  </tr>
  <tr>
    <td>Department</td>
    <td><?php echo $dep; ?> </td>
  </tr>
</table>
<br>
<br>

HTML;


}

>>>>>>>>>PHP CODES<<<<<<<<<<<<<<

Link to comment
https://forums.phpfreaks.com/topic/189016-echo/
Share on other sites

I don't think it will parse the php that way. Try this

>>>>>>>>>PHP CODES<<<<<<<<<<<<<<

mysql_connect("localhost", "admin", "Pass") or die(mysql_error());
mysql_select_db("movedb") or die(mysql_error());

$find = strtoupper($find);
$find = strip_tags($find);
$find = trim ($find);

$data = mysql_query("SELECT * FROM sheet1sa WHERE upper($field) LIKE'%$find%'");

while($result = mysql_fetch_array( $data ))
{ 
// 
?> 
<table width="400" border="0" class="sample">
  <tr>
    <td width="97" rowspan="5"><?php echo $F6; ?></td>
    <td width="125">Name, Lastname</td>
    <td width="164"><?php echo $name; ?></td>
  </tr>
  <tr>
    <td>Cell Number </td>
    <td><?php echo $cell; ?></td>
  </tr>
  <tr>
    <td>Extension Number </td>
    <td><?php echo $ext; ?></td>
  </tr>
  <tr>
    <td>Office Number </td>
    <td><?php $F2; ?></td>
  </tr>
  <tr>
    <td>Department</td>
    <td><?php echo $dep; ?></td>
  </tr>
</table>
<br>
<br>
<?php 
}

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/189016-echo/#findComment-997979
Share on other sites

?>
<table width="400" border="0" class="sample">  <tr>    
<td width="97" rowspan="5"><?php echo $F6; ?></td>    
<td width="125">Name, Lastname</td>    <td width="164">{$name}, </td>  </tr>  
<tr>    <td>Cell Number </td>    <td><?php echo {$cell},  ?></td>  </tr>  
<tr>    <td>Extension Number </td>    <td><?php echo $ext; ?></td>  </tr>  
<tr>    <td>Office Number </td>    <td><?php $F2; ?></td>  </tr>  
<tr>    <td>Department</td>    <td><?php echo $dep; ?></td>  </tr></table><br>
<br>
<?php

 

Neither of these works :(!!!!

 

Well the last reply messed up my pgae

Link to comment
https://forums.phpfreaks.com/topic/189016-echo/#findComment-998019
Share on other sites

Bu as I said if I just call this variabales ouside of my HTML area I can see the result so there is nothing wrong with that variable example if i use

 


$data = mysql_query("SELECT * FROM sheet1sa WHERE upper($field) LIKE'%$find%'"); 
while($result = mysql_fetch_array( $data )) 
{ 

echo $cell;

 

I'll see the cell number but if I put in that HTML format nothing shows up

Link to comment
https://forums.phpfreaks.com/topic/189016-echo/#findComment-998039
Share on other sites

I'm pretty sure there is no error, I've tried that I didnt get anything..

 

well here is my whole scrpt do you mind take a look at it and tell me if it looks OK or not!?

 

<link href="../css/lightstyle.css" type="text/css" rel="stylesheet" />
<?php include("../header.php"); ?>
<script type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>

<form name="search" method="post" action="<?=$PHP_SELF?>">
<fieldset><legend>Phonebook System</legend><input name="find" type="text" value="Search" maxlength="100" />
  <div align="left"><h5>
    
    <Select NAME="field" class="arad">
      <option value="name">Name and(or) Last name</option>
      <option value="cell">Cell Number</option>
      <option value="ext">Extension / Office</option>
      <option value="dep">Department</option>
    </Select>
    <input type="hidden" name="searching" value="yes" />
    <input type="submit" name="search" value="Search" class="btt1"/>
  </div>
</form>

  
    <div align="left">
      <p>
        <? 
if ($searching =="yes") 
{ 
echo "<h5>Results<p>"; 

if ($find == "") 
{ 
echo "<p>You forgot to enter a search criteria"; 
exit; 
} 

mysql_connect("localhost", "Uganda", "u^77HYuj***$$") or die(mysql_error()); 
mysql_select_db("movedb") or die(mysql_error()); 


$find = strtoupper($find); 
$find = strip_tags($find); 
$find = trim ($find); 

//Now we search for our search term, in the field the user specified 
$data = mysql_query("SELECT * FROM sheet1sa WHERE upper($field) LIKE'%$find%'"); 

while($result = mysql_fetch_array( $data )) 
{ 

echo <<<HTML
<table width="400" border="0" class="sample">
  <tr>
    <td width="97" rowspan="5"><? echo $F6; ?> </td>
    <td width="125">Name, Lastname</td>
    <td width="164"> <? echo $name; ?> </td>
  </tr>
  <tr>
    <td>Cell Number </td>
    <td> <?php echo $cell; ?> </td>
  </tr>
  <tr>
    <td>Extension Number </td>
    <td> <?php echo $ext; ?> </td>
  </tr>
  <tr>
    <td>Office Number </td>
    <td><?php echo $F2; ?> </td>
  </tr>
  <tr>
    <td>Department</td>
    <td><?php echo $code; ?> </td>
  </tr>
</table>
<br>
<br>

HTML;


} 
$anymatches=mysql_num_rows($data); 
if ($anymatches == 0) 
{ 
echo "<h5>Sorry, but I can not find the person that you are looking for.<br>Please .<br><br>Thanks"; 
} 

//And we remind them what they searched for 
echo "<b><h5>Searched For:</b></b> " .$find; 
echo "<br>"; 
echo "<br>"; 
} 
?>
<head>
</head>
<body>
      </p>
      <p> </p>
      <hr width="500" size="1" />
      <p> </p>
      <p> </p>
      <p align="center">
</p>
</body>
  </html>    

Link to comment
https://forums.phpfreaks.com/topic/189016-echo/#findComment-998059
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.