HI
I need to select one item from one database and write the result field in one place of my webpage, but when I write with echo"xxxx" it writes the value at the begining of the page. How can i choose the place where i write the result? I have to use css?
Thank you
Choose place where write text
Moderator: General Moderators
-
mariolopes
- Forum Contributor
- Posts: 102
- Joined: Sun May 22, 2005 7:08 am
Re: Choose place where write text
Hi,
Please show us your code. echoing something should place it right where you put the echo. I've seen cases where it doesn't, such as in templating.. so your code will be necessary.
Please show us your code. echoing something should place it right where you put the echo. I've seen cases where it doesn't, such as in templating.. so your code will be necessary.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
-
mariolopes
- Forum Contributor
- Posts: 102
- Joined: Sun May 22, 2005 7:08 am
Re: Choose place where write text
HI
Here is my code:
One of my options was try to write the value in one input named designacao but it seems doesn't work.
Here is my code:
One of my options was try to write the value in one input named designacao but it seems doesn't work.
Code: Select all
<?php
session_start();
include "tab.html";
echo"<link href='negocios.css' rel='stylesheet' type='text/css'>\n";
echo"<div class=formulario>";
echo"<form method='POST' >";
echo" <fieldset>";
echo" <legend>Pesquisa:</legend>";
echo" Código: <input type='text' name='codigo' size='10' />";
echo" <input type='Submit' value='Pesquisar'/>";
echo"<br/>";
echo"<br/>";
echo"Designação: <input type='text' name='designacao' size='50' value='";echo $descricao;echo "' />";
echo" </fieldset>";
echo"</form>";
echo"</div>";
$mysql_id = mysql_connect('localhost', "xxx", "xxx");
mysql_select_db('mariolopes',$mysql_id);
if (isset($_POST['codigo'])){
$query="select * from negocios where Codigo='$_POST[codigo]'";
$result=mysql_query($query);
$numlinhas=mysql_num_rows($result);
echo $numlinhas;
if ($numlinhas==0){
$_SESSION['descricao']="";
echo "Sem linhas";
exit;
}
while ($row=mysql_fetch_array($result)){
$descricao=$row['Designacao'];
echo $descricao;
}
}
?>Re: Choose place where write text
You only have echo statments at the top of the page, so where do you think they will appear?