nav33n 472 Purple hazed! Team Colleague Featured Poster

while($row==mysql_fetch_array($res));

Remove the ; at the end.
Its $row= and not $row==.

also send me the exact code to fetch a table from a database in a table format in a web page!!!!!

You need to figure that out yourself.. Check the example here.
http://www.w3schools.com/php/php_mysql_select.asp

nav33n 472 Purple hazed! Team Colleague Featured Poster

echo '<image src="'.$row.'" width=50 height=80>';

Thats wrong.
1. Its <img tag.
2. You can't directly give Img src = $row.

Check this or this .

nav33n 472 Purple hazed! Team Colleague Featured Poster

would this not just send the image as the message and not put any of the text to go with it.

No. Since you are concating previous value of $message with the images, the text along with images will be sent.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Yep. Thats possible. Write the images to a page. Send the mail with attachments.

nav33n 472 Purple hazed! Team Colleague Featured Poster

I didn't get you.. What I said was,
concat <img src='row1> to $message. So, it will be like,
$message.=$row1;
then again,

$message.=<p>&nbsp;</p></div></th>
        <td width=\"77%\" scope=\"col\"><table width=\"99%\" border=\"0\" cellpadding=\"10\" cellspacing=\"0\">
            <tr> //.... and so on
nav33n 472 Purple hazed! Team Colleague Featured Poster

Instead, assign it to $message.
$message.="<img src=$row>";

nav33n 472 Purple hazed! Team Colleague Featured Poster

You can't see the image. You need to write a php script to see the image.

nav33n 472 Purple hazed! Team Colleague Featured Poster

You can't have

                <?php

                $query = "SELECT broad1 FROM images_broad";
                $result=mysql_query($query);

                while($row=mysql_fetch_array($result, MYSQL_ASSOC)){
                echo '<img src="'.$row['broad1'].'"/>';
                }

                ?>

in $message. Since it is already a php variable. Assign only the <img src value to $message. Then try again. That will surely fix one of your problems.

nav33n 472 Purple hazed! Team Colleague Featured Poster

You can't view an image from mysql console.

nav33n 472 Purple hazed! Team Colleague Featured Poster

You can use php's mail function..

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

document.formName.task.value=='del';

Should be document.formName.task.value='del';

Venom Rush commented: helped alot ;) +1
nav33n 472 Purple hazed! Team Colleague Featured Poster

Nope.. $_POST will not hold any value. You can do it this way (again, as DangerDev mentioned), have a hidden variable (task). When you click on 1st button, assign a value to task variable. document.formname.task.value='add'; Similarly, assign another value when another button is clicked. document.formname.task.value='delete'; Then you can check what value task variable holds.

if($_POST['task']=="add"){
//add
} 
if($_POST['task']=="delete"){
//delete
}
nav33n 472 Purple hazed! Team Colleague Featured Poster

Can you post your original code ?

Edit: Btw, for the first execution, $first will be null.. Thats the reason it shows an empty alert.

nav33n 472 Purple hazed! Team Colleague Featured Poster

eg. document.formname.submitButtonName.submit();

I dont think you can. But you can do this. Instead of having a submit button for delete button, have a normal button as DangerDev has mentioned. Then onclick call a javascript function and submit the page. Eg.

<?php
	print_r($_POST);
?>
<html>
<head>
<script type="text/javascript">
function delsubmit() {
	var conf;
	conf=confirm("Are you sure ?");
	if(conf) {
		document.test.submit();
	} else {
		return false;
	}
}
</script>
</head>
<body>
<form name="test" method="post" action="<?php echo $PHP_SELF; ?>">
<input type="text" name="name" value="1">
<input type="button" name="button" value="Delete" onclick="javascript: return delsubmit();">
</form>
</body>
</html>

This is just a simple example. The next snippet of code will not work, because there is already a submit button. Eg.

<?php
	print_r($_POST);
?>
<html>
<head>
<script type="text/javascript">
function delsubmit() {
	var conf;
	conf=confirm("Are you sure ?");
	if(conf) {
		document.test.submit();
	} else {
		return false;
	}
}
</script>
</head>
<body>
<form name="test" method="post" action="<?php echo $PHP_SELF; ?>">
<input type="text" name="name" value="1">
<input type="submit" name="submit" value="add">
<input type="button" name="button" value="Delete" onclick="javascript: return delsubmit();">
</form>
</body>
</html>

To make both of them work, you should have 2 buttons. Eg.

<?php
	print_r($_POST);
?>
<html>
<head>
<script type="text/javascript">
function delsubmit() {
	var conf;
	conf=confirm("Are you sure ?");
	if(conf) {
		document.test.submit();
	} else {
		return false;
	}
}
</script>
</head>
<body>
<form name="test" method="post" action="<?php echo $PHP_SELF; ?>">
<input type="text" name="name" value="1">
<input type="button" name="button" value="add" onclick="javascript: document.test.submit();">
<input type="button" name="button" value="Delete" onclick="javascript: return delsubmit();">
</form>
</body>
</html>

If you still have problems, let me know!
Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

Beer mug ? Party time ? eh ? ;)

nav33n 472 Purple hazed! Team Colleague Featured Poster

1. You forgot mysql_query in

$result=("SELECT name FROM lydia WHERE nam='$name1'");

2.

<input name="text" name="name1">

Should have been input type="text".
And, at the first run, ie., when the script is executed for the 1st time, the query will not output anything since $_REQUEST is empty.(or it will output the rows which has an empty nam field). Why not have form method as Post ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb !
He was thanking in advance :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Umm.. Dani, just wondering ! What did you do at SES ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

-942

nav33n 472 Purple hazed! Team Colleague Featured Poster

Notices are not errors. You can get rid of notices by initializing a variable before using it.

nav33n 472 Purple hazed! Team Colleague Featured Poster

No..that isn't the problem.. The problem is missing ; in here..

echo "<tr>"

nav33n 472 Purple hazed! Team Colleague Featured Poster

-939

nav33n 472 Purple hazed! Team Colleague Featured Poster

so your the queen

Yep! Daniweb kingdom is ruled by a queen ;)

nav33n 472 Purple hazed! Team Colleague Featured Poster

-937

nav33n 472 Purple hazed! Team Colleague Featured Poster

hmm.. Anyway, you solved your problem and congrats for that! :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

I'm probably getting annoying now.

Lol.. Nah !

Anyway, if its connecting to getjobnumber.php page, what is the name of this page ? If this is a different page, put

$jobnumber=$_POST['job_number'];

$con = mysql_connect("localhost","root","rilke123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("parsec", $con);

$query = "SELECT * FROM customers WHERE job_number='$jobnumber'";
$result = mysql_query($query);
while($row = mysql_fetch_array($result)){
echo $row['first_name'];
echo $row['last_name'];
//etc...
}

in getjobnumber.php page.

nav33n 472 Purple hazed! Team Colleague Featured Poster
<?php
print_r($_POST);
?>
<html>
<head>
<script type="text/javascript">
function save()
{
document.getElementById("schdate").value  = document.getElementById('nextsch').value;
alert ("date"+document.getElementById('schdate').value);
//when i alert it had value
}
</script>
</head>
<form name="mainform" method="post" action="1.php?impt=<?= $impt ?>">
<table>
<tr>
<td align='center' width='100'>	
	<input type='text' id='nextsch' name='nextsch'>&nbsp;</td>
	<input type=hidden name=schdate id=schdate>
	</tr></table>
<input type="submit" value="Save" name="Save" tabindex="7" style="font-size: xx-small" onclick="save();">
	</form>
</body>	
</html>

Check this..

var imp = document.getElementById('yesno').checked;

var imp will always be true with this. You can use if condition or document.getElementById('yesno').value;
Remove value='null'.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Where are you calling the javascript function ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Umm.. you have one textbox to enter the job number ? When the user enters his job number and click on submit, all his details should be displayed ? Is that right ?
Here is an example.

<?php
if(isset($_POST['submit'])) {
	$jobnumber=$_POST['jobnumber'];
	//connect
	//selectdb
	$query = "select * from table where jobnumber='$jobnumber'";
	$result = mysql_query($query);
	while($row = mysql_fetch_array($result)){
		echo $row['columnname']; //allign it however you want to display
		echo $row['columnname1']; 
		//etc...
	}
}
?>
<html>
<body>
<form method="post" action="getjobnumber.php">
<input type="text" name="jobnumber"><br>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
nav33n 472 Purple hazed! Team Colleague Featured Poster

Exactly !

nav33n 472 Purple hazed! Team Colleague Featured Poster

DangerDev, you can know which button was pressed by giving each button a unique name. In my example, I have called it submit1 and submit2.

nav33n 472 Purple hazed! Team Colleague Featured Poster

DangerDev, My problem is that I don't know javascript very well and haven't been able to find any solutions. Is the section of code for submitting the form correct?

document.formname.submit();

P.S. You can have two submit buttons on one form. I've used it successfully on many pages.

Since you are already using the submit button in your form, you can't submit that way (I think).

nav33n 472 Purple hazed! Team Colleague Featured Poster

You can actually have 2 submit buttons in a form. Eg.

<?php
if($_POST['submit1']) {
	echo "Submit1 pressed! Add/update the records";
}
if($_POST['submit2']){
	echo "Submit2 was pressed ! Now delete the records !";
}
?>
<html>
<head>
<script type='text/javascript'>
function confirmdel() {
	var val = confirm("Do you really want to delete ?");
	if(val) {
		return true;
	} else {
		return false;
	}
}
function calltest() {
	alert("Hi there!");
	return true;
}
</script>
</head>
<body>
<form method="post" action="thispage.php" onsubmit="javascript: return calltest();">
<input type="submit" name="submit1" value="add"><input type="submit" name="submit2" value="delete" onclick="javascript: return confirmdel();">
</form>
</body>
</html>

But, since both the buttons are submit buttons, onSubmit event will be fired when you click either of the buttons.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hello ! Welcome to Daniweb !

Looks like an interesting place to get info when I break my computers! Cause that's what I'm good at, breaking not really fixing them

Lol !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hey there Jim! Welcome to Daniweb !

nav33n 472 Purple hazed! Team Colleague Featured Poster

you try to take something somebody has written and make something different from it -

Now you have overstepped all boundaries of decency.

Please backup your accusation or make an unreserved apology.

echo!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Setting the action of a form using javascript is idiotic. That was my point, not yours. That I pointed it out has caused you to continue trolling like this ever since.

LOL..

A well written script will function without either javascript or Ajax. A good example: stupid_site snipped

This is typical of your trolling - you try to take something somebody has written and make something different from it - bravo! If you insist on putting it that way (which I never said) then yes, it can be done.... you think about it.

LOL again ! I "try" to take "something" "somebody" has written and make "something" different from it. I take something somebody has written and make something different from it(I never said that anyway!). But I dont steal others code (like you!).

Yes, its very sad that you cannot see the difference between smileys and a login form. One is essential, the other not.

Stupidity has no boundary. The point that I made was

If javascript is disabled, even the form validation/ajax wouldn't work.

and the reply that I get is,

What Ajax? A well written script will function without either javascript or Ajax. A good example: stupid_site_snipped

You contradicted your own statement by saying

Yes, its very sad that you cannot see the difference between smileys and a login form. One is essential, the other not.

which means, you agree that some features DOESN'T work when javascript is turned off.

Do you actually have a …

nav33n 472 Purple hazed! Team Colleague Featured Poster

I am glad your problem is solved now !

if you ever in Liverpool, England let me know i will take you out for a drink you deserve one.

Thanks for that man ! I am in Netherlands at the moment, but my visa doesn't permit me to come to GB! Anyways, Cheers !

nav33n 472 Purple hazed! Team Colleague Featured Poster

For this question

if anybody here knows how to edit the background layout of blogger blogs.

I said, post it in Html and css forum. You might get better replies in that forum.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome back ! :) Please post your question in html and css forum !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Then you can truncate the table instead of dropping it and creating a new one ! mysql_query("Truncate table tablename"); will do the trick !

kevin wood commented: if you need help with php/mysql he is your man +1
nav33n 472 Purple hazed! Team Colleague Featured Poster

Do you want only 1 image to be inserted at a time for all the users ? That is, if user A uploads an image, then delete the table, create the table again, insert the values to the table. Then if user B uploads an image, again, delete the table, create the table again and insert the values to the table ? If thats the case, why not truncate the table instead of dropping it ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Why not go to a freelancer or learn the basics of fetching the data from mysql table using a condition and display it . I don't want to sound harsh or something, but, my suggestion is, learn how it works.

nav33n 472 Purple hazed! Team Colleague Featured Poster

You are welcome :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

I don't know what your code does. So, I can't write you the 'actual working code'. You wrote that piece of code, Right ? If yes, then this shouldn't be difficult.