ko ko 97 Practically a Master Poster

Echo $rs_insert_scan before mysql_query() statement and see what returns. Is it the right query syntax what you're expecting ?

ko ko 97 Practically a Master Poster

You must have break for each case. Also, you should use variable within switch parantheses which likes switch($interval) instead switch(true).

ko ko 97 Practically a Master Poster

Mark as Solved then.

ko ko 97 Practically a Master Poster

Solved ? Mark it as Solved then.

ko ko 97 Practically a Master Poster

Use mysql_real_escape() function to filter the input rather than str_replace(). Or use PDO.

ko ko 97 Practically a Master Poster

Which "index.php" are you referring ? Admin "index.php" or front-end "index.php" ? You should check here first.

ko ko 97 Practically a Master Poster

issset() don't check for null. It just check the variable has already set or not. If the variable already defined or set, it return true, and return false otherwise. Your code will always work every time the form has submitted, because it just send empty value (it is not null) even if there is no value within the form. You should try like what @rajengg mentioned above.

ko ko 97 Practically a Master Poster

Well. No one listen to the forum rules. You might mark as Solved when your problem was solved.

ko ko 97 Practically a Master Poster

Solved ? Marked it as Solved then.

ko ko 97 Practically a Master Poster

Probably, you may have XMLHTTPRequest problem. Are you sure crearXMLHttpRequest() works on IE and you get new XMLHTTPRequest ? Should try what @pritaeas said.

ko ko 97 Practically a Master Poster

Check RegEx.

ko ko 97 Practically a Master Poster

What mean "I mean it looks good, but It's erroring up...?" You don't even check your code that it does work or not ? Post what you're trying with that codes and what problem you're getting.

ko ko 97 Practically a Master Poster

Remove your previous Apache installation is better. Otherwise, you may have port conflict which XAMPP/WAMPP use port 80 for HTTP and your previous Apache service also. So, uninstall your previous Apache and install XAMPP/WAMPP package. They already built-in with PHP, Apache, MySQL, FTP and so on. Note that if your PC already installed IIS and it's running, then, you need to stop IIS first before running XAMPP/WAMPP coz IIS also use port 80.

ko ko 97 Practically a Master Poster
foreach ($_POST as $key => $value) {
     echo $value;
}

What's still wrong ? The above method should work.

ko ko 97 Practically a Master Poster

SELECT contact_financial_invoiceamount-contact_financial_payment AS outstanding

You must be missing comma between each field names which was bold. You should separate the query string and function. Here is readable format and less errors.

$sql = "SELECT contact_financial_invoice, amount-contact, financial_payment AS outstanding FROM contacts WHERE contact_id = ".$_GET['id'];
$result = mysql_query($sql);

ko ko 97 Practically a Master Poster

I'm not clear what you're saying. You want to show the country flag when the country was changed ? Can't it be done with Javascript or jQuery with 'onchange' event to that country selector ? Your question rarely related with the client-side, not server-side.

ko ko 97 Practically a Master Poster

You must use HEADER with proper MIME type to prompt the download immediately when you click the download button. The above @tyson567 methods just send you the new page where the image located, it'll not prompt you to download the image when you reached that page. Here is the example for method 1. The method 2 can be done with Javascritp or jQuery plugin. You just need to google for that.

ko ko 97 Practically a Master Poster

What's the problem ? The above PHP codes are not working or are you getting errors? Showing your entire codes could not help us to says where the problem is. You should just posted the part of the code what you think that it might not work.

ko ko 97 Practically a Master Poster

It's not notepad what @veedeoo is mentioning. Notepad is not good IDE to write the code or any programming language. You should use another IDE which has more features and good supporting for multiple programming languages such as PHP, HTML, ASP or Java. Here are some good tools you should try. Notepad++ ( http://notepad-plus-plus.org/download/v6.1.3.html ), SublimeText2 ( http://www.sublimetext.com/2 ), AptanaStudio3 ( http://www.aptana.com/products/studio3/download ). I prefer to use Notepad++ and SublimeText2 rather than AptanaStudio3. These two IDEs are comfortable with small projects like PHP, HTML, Javascript and any web development.

ko ko 97 Practically a Master Poster

We need further information. Also, it is better if you have well-known about DOM for complete this case.

ko ko 97 Practically a Master Poster

Only submit button should be identified for one form. No matter how much submit buttons are you using within the same form, they've only submission of that form.

Try what @Glider Pilot mentioned above.

ko ko 97 Practically a Master Poster

Check here.

ko ko 97 Practically a Master Poster

You're using POST method, not GET. How you receive that "action" $_GET will not get any value from the form. It should be $_POST;

ko ko 97 Practically a Master Poster

datatype: 'json', should be dataType

ko ko 97 Practically a Master Poster

If the problem solved, then mark as Solved.

ko ko 97 Practically a Master Poster

Why you're trying to pass the value as function argument. If you know the ID of the field, then, you can easily get the value within the function.
Example:

function goNow(){
    var input = document.getElementById('theName').value;
    // do your statement
}

Binding event that function without argument onClick="goNow()"
It should work.

ko ko 97 Practically a Master Poster
function verify(){
   var image = new Image();
   if(!document.getElementById('jim1').value().match('/[0-9]/')){
       image.src = 'path/success-image.gif';
       document.getElementById('jim3').appendChild(image);
   }
   else{
       image.src = 'path/error-image.gif';
       document.getElementById('jim3').appendChild(image);
       alert('Error !');
   }
   return false; // this line will prevent the form submitted
}

Attach the above function to your button with onclick event. Note that it was not tested and may not work. Try yourself !

ko ko 97 Practically a Master Poster

I've no idea, how you're going to be complex to the easy one. If you've configuration like such. Then, you can simply change their value directly in that file as @ardav mentioned.

ko ko 97 Practically a Master Poster
if(!function_exists('render')){
     //put your render function
     function render(){
     }
}

Try above. Anyway, what is the PHP version ? And check the system requirements for Drupal 7.12 to ensure it is compatible with your PHP version.

ko ko 97 Practically a Master Poster

Post the error what you're getting. Actually, you need web server and MySQL for installing Magneto.

ko ko 97 Practically a Master Poster

There is no one who write the code for you. Post what you've and what you got. We'll point you the correct way.

ko ko 97 Practically a Master Poster
<?php
mysql_connect("localhost", "root", "test") or die(mysql_error());
echo "Connected to MySQL<br />";
mysql_select_db("testdb") or die(mysql_error());
?>


<?php

@$username = $_POST['name'];
@$country = $_POST['country'];


?>

Put this in form.php, remove include(form.php) and try. If you want to show the form again. Redirect to that page when the INSERT finished with custom message, FAILS or SUCCESSES. There is a lot of tutorials on the internet. You can google for that.

ko ko 97 Practically a Master Poster
<?php
phpinfo();
?>

What does it return ? Also, don't put the bracket with echo statement.

<?php
echo "Hello";
?>

It should be.

ko ko 97 Practically a Master Poster

You need to wrap FORM. Otherwise, use GET method to pass those values with ((param1=value1&param2=value2) separating ampersand between them) via URL to the page you want to process. Then, you can retrieve $_GET, $_GET. But, this is stupid method and you need to do some javascript tricks. It is non-sense ! Use the FORM.

ko ko 97 Practically a Master Poster

mysql_fetch_assoc($w3db), change $w3db to $w3 or use @ardav method. It is better way.

ko ko 97 Practically a Master Poster

@vaultdweller123, if you're W3Schools fun. Then, check this http://w3fools.com/

@rubai, you should go to php.net from novice to pro.

ko ko 97 Practically a Master Poster

You might have wrong db structure.
Separate the user table and order table. User table should has ID numbers, names and ordered. Also, order table should has ID numbers, names and quantities.

For example, if one user click cheese to order, then update the ordered field (insert the ID number of the ordered item) from user table where username/id is the user/user's id who made the order. If the user made more than one orders, you can store the id numbers of the ordered item together with comma (1,2,3 etc).
And then, you might update quantities field from order table where the field 'quantities' is Cheese. So, you can analyze how many orders exist for each item. Once, the user has finished the ordered process or logged out without finishing the order process, you must remove the order from that user.

Hope this help.

ko ko 97 Practically a Master Poster
[B]$qtyProd= $_POST['qtySelectProd'];[/B]

- Where is qtySelectProd in the form ? I don't see that field in the form.
- qtySelectSer, you have only qty value qtySelectSer, check your HTML option value within the loop.

for ($n=0; $n<11; $n++){ echo "<option value=qty>".$n."</option>";
}

ko ko 97 Practically a Master Poster

Solved ? If then, mark as Solved.

ko ko 97 Practically a Master Poster

Post the codes in site.php.

ko ko 97 Practically a Master Poster

Check this.

ko ko 97 Practically a Master Poster

Try this:

if(isset($_POST['firstName'] && $_POST['lastName'])) {
$text=$_POST['firstName']." ".$_POST['lastName'];
$to="anubhavjhalani09@gmail.com";
$subject="Message from php";



//data insert into database
$sql="INSERT INTO entries (contents)
VALUES
('$text')";

echo $text;
}
ko ko 97 Practically a Master Poster

select * from emp1, make sure that table name is correct, emp with 1 or l ?

ko ko 97 Practically a Master Poster

Did you include db_connection.inc file into db_connect.inc ? Perhaps, like below:

<?php
include('db_connection.inc');

function db_connect ()
  {
  include'db_connection.inc';
  $dbh = new PDO("mysql:host=127.0.0.1;$database", $user, $password);
  return ($dbh);
  }
?>
ko ko 97 Practically a Master Poster

Try this:

<?php
if (isset($_SESSION['uid']) && $_SESSION['uid']) {
    echo "You are already logged in, if you wish to log out, please <a href=\"./logout.php\">click here</a>!\n";
} else {
    if (isset($_POST['submit'])) {
		$user = (isset($_POST['username'])) ? $_POST['username'] : '';
		$pass = (isset($_POST['password'])) ? $_POST['password'] : '';
		
			if($user != '' && $pass != ''){
				$user = mysql_real_escape_string(strip_tags($user));
				$pass = mysql_real_escape_string(strip_tags($pass));
				
				$sql = "SELECT id FROM `users` WHERE `username`='".$user."'";
				$res = mysql_query($sql) or die(mysql_error());
				if(mysql_num_rows($res) > 0){
					$sql2 = "SELECT id FROM `users` WHERE `username`='".$user."' AND `password`='".md5($pass)."'";
					$res2 = mysql_query($sql2) or die(mysql_error());
					if(mysql_num_rows($res2) > 0){
						$row = mysql_fetch_assoc($res2);
						$_SESSION['uid'] = $row['id'];
						
						echo "You have successfully logged in as " . $user . "<br><br><a href=\"./index.php\">Proceed to the Forum Index</a>\n";
					}else {
						echo "Username and password combination are incorrect!\n";
					}
				}else {
					echo "The username you supplied does not exist!\n";
				}
			}else {
				echo "You must supply both the username and password field!\n";
			}
	}
	else {
	?>
		<table border=0 cellspacing=3 cellpadding=3>
		<form method='post' action='login.php'>
		<tr><td>Username</td><td><input type='text' name='username'></td></tr>
		<tr><td>Password</td><td><input type='password' name='password'></td></tr>
		<tr><td colspan=2 align='right'><input type='submit' name='submit' value='Login'></td></tr>
		</form></table>	
	<?php
	}

}
?>
ko ko 97 Practically a Master Poster

What is it on line 120 ? Post that line.

ko ko 97 Practically a Master Poster
[B]action="<?php echo $_SERVER['SCRIPT_NAME'];?>[/B]

From action is wrong. $_SERVER returns the current file name with system path, not URL. Should use '$_SERVER' or '$_SERVER'.

And this one should be better for error message.

if (isset($err) && $err != '') {
echo "<strong>Form Error(s)</strong><br/>";
echo "<font color='#cc3300'>". nl2br($err). "</font><br/>";
}
?>

Hope this help.

ko ko 97 Practically a Master Poster

First, check your mysql server is running or not like @ardav mentioned?
Second, how are you using mysql_connect() function in your php? mysql_connect() needs three arguments (host, username, password).

Check the above facts and post again if your problem still keep going.

ko ko 97 Practically a Master Poster

Then, mark as Solved with the link below the editor.

ko ko 97 Practically a Master Poster

Try this:

<?
if (isset($_POST['Submit'])){
 
	$fd = fopen ($form_data, "r");

	while(!feof($fd)) {
		$line = fgets($fd);
		
		list($data[$counter]->name, $data[$counter]->pass) = explode(',', $line);
		$counter++;
	}

	fclose ($fd);

	foreach($data as $user) {
		$sql = "INSERT INTO `table_name` (`field_1`, `field_2`)
				VALUES('$user->name', '$user->pass')";
		mysql_query($sql) or die('Cannot insert the data. Error: ' . mysql_error());
	}
}
?>
 
<form method="post" action="" enctype="multipart/form-data">
 
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
<br>File to upload:<br>
<input type="file" name="form_data" size="40">
<p><input type="submit" name="Submit" value="Submit">
</form>

Not tested ! Post again if there is still problem with the above codes.