Help !!!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
silgol
Forum Newbie
Posts: 11
Joined: Fri Jan 24, 2003 1:31 pm

Help !!!!

Post by silgol »

I want that in following script when digitar in the field of the
corresponding mail, automaticamente it opens outlook to send a mail to
him to that personnel.


<HEAD>
<TITLE>leer.php</TITLE>
<Link rel= "stylesheet" href="default.css">
</HEAD>
<BODY>
<h1><div align="center">Phones</div></h1>
<br>
<br>
<?
echo "<form name='listado' method=post action='personal2.php'>";
mysql_connect("localhost","fime","itg01");
$result=mysql_db_query("auth","select * from Personal order by nombre");
$number = MySQL_NUM_ROWS($result);
echo"<table width=500 align=center bgcolor = cccccc border=9 cellpadding=7 cellspacing=7>
<tr>
<td><br><input type=submit value=&laquo;><input type=submit value=&raquo;>
<b>Nombre</td></b>
<td><br> <input type=submit value=&laquo;><input type=submit name=Inter value=&raquo;>
<b>Interno</b><td><br><b>mail</b></td>
</tr>";
while($row=mysql_fetch_row($result)){
echo"<tr>
<td>$row[1]</td><td>$row[4]</td>
<td>$row[5]</td>
</tr>";
}
echo"</table>";
?>


Since I do so that the data order according to the field that
I select, or internal name or?
User avatar
daven
Forum Contributor
Posts: 332
Joined: Tue Dec 17, 2002 1:29 pm
Location: Gaithersburg, MD
Contact:

Post by daven »

1. you can only have one <input type="submit"> in a form
2. Do not use ampersands (&) in your values
3. I do not think PHP can open manipulate Outlook. Instead, look into PHP's mail() function.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

you can have multiple instances of &lt;input type="submit"&gt; in a form but only the activated one's value will be transmitted, e.g.

Code: Select all

<html>
	<body>
		<pre><?php print_r($_POST); ?></pre>
		<hr />
		<form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>">
			<input type="submit" name="mode" value="something" /><br />
			<input type="submit" name="mode" value="something else" /><br />
			<input type="submit" name="mode" value="something completely different" /><br />
		</form>
	</body>
</html>
&amp;laquo and &amp;raquo are entities ( « » ) so he might use them there. But you should quote all properties of an html-element, e.g.

Code: Select all

&amp;lt;input type="submit" value="&amp;amp;laquo;" /&amp;gt;&amp;lt;input type="submit" value="&amp;amp;raquo;" /&amp;gt;
but take care of escaping those quotes as long as you're using echo "...".
There are some other odd things about your html-structure I don't really understand but anyway...

php cannot access the client's mail-prg, but you can use the mailto:-protocol. With this the clientbrowser is asked to open the mailprg. But the user has to confirm the mail.
Via javascript you're able to set receipient, topic and body of the mail.
Search for javascript and mailto e.g. with google
Post Reply