nav33n 472 Purple hazed! Team Colleague Featured Poster

echo "<div class='error'>Text</div>"; If you want to use double quotes, you should escape those quotes. Eg. echo "<div class=\"error\">Text</div>";

nav33n 472 Purple hazed! Team Colleague Featured Poster

Exactly :P

nav33n 472 Purple hazed! Team Colleague Featured Poster
if(empty($_POST['username']) && empty($_POST['password'])) {
	echo "Both empty"; 
	exit;
} 
if(empty($_POST['username'])){
	echo "username empty!";
	exit;
} 
if(empty($_POST['pass'])){
	echo "pass empty!";
	exit;
}

First validate for both the fields. Then other fields.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Thats because, It will exit when it encounters first if(empty($_POST)).

nav33n 472 Purple hazed! Team Colleague Featured Poster
if($_POST['username']==""){
  echo "Username empty!";
} 
if($_POST['password']==""){
 echo "Password empty!";
}
if($_POST['username']=="" && $_POST['password']=="") {
 echo "Both username and password is empty!";
}

This will do the same as what you are trying to do.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Whats the error ?
Oops! I am getting blind. Check if-elseif-else condition .

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) You are welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

That doesn't check for blank. Try

if(empty($_POST['username'])){
   echo "Empty username!";
}
//or you can also do it this way
if($_POST['username']==""){
 echo "Empty username!";
}
nav33n 472 Purple hazed! Team Colleague Featured Poster

hmm.. IE7 has a lot of problems, i believe.
But, wont the dropdown be populated by the value which you give within option tag ? like, <option value="someurl1.php">Classic 1</option> . I mean, wouldn't it show classic 1 in the dropdown list ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

But it works that way already in the live webpage.

I will try what you suggest but i don't think it will make any difference. The current live page is found at www.personally-yours.co.uk/onthisday.htm. This drop down is part of the input into the paypal ordering system.

That live page cannot be found. And nowhere I have seen a select box with 2 values. (sorry for my ignorance!)

nav33n 472 Purple hazed! Team Colleague Featured Poster
$target_path="/home/install/trial";
$target_path=$target_path.basename($_FILES['uploaded']['name']);

target_path is not correct. You need to have a "/" after trial. Else, target_path will be like this.
home/install/trialfilename.(in short, it will upload (if it does) it in install directory.)
Strangely, It still uploads even if I dont give anything in upload_tmp_dir. I am sorry ! I give up.

nav33n 472 Purple hazed! Team Colleague Featured Poster

But it should be var x = document.form.element.value and not var x=document.form.element.value2 I dont think you can have <option value="something" value2="something">something </option> ! Instead put contents in value2 to value and then try.

nav33n 472 Purple hazed! Team Colleague Featured Poster

ur working in windows n i am in linux.

That was not my point. What I was trying to say was, session.save_path is taking the tmp value, but not upload_tmp_dir. But anyway, Could you post your code that you are using to upload ? Maybe theres a problem with your code ?

nav33n 472 Purple hazed! Team Colleague Featured Poster
function showimage()
{
if (!document.images)
return
document.images.pictures.src=
document.forms.os0.options[document.mygallery.os0.selectedIndex].value2
}

.value2 ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

hmm.. Well, I ll show you what I have in my phpinfo. Notice the changes.

upload_tmp_dir	c:/wamp/tmp	c:/wamp/tmp
....
.....
......
session.save_path c:/wamp/tmp c:/wamp/tmp
....
.....

Your phpinfo says, session.save_path /tmp /tmp . So, there exists a tmp directory and its not configured correctly in your loaded php.ini file :) Thats the conclusion !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Can you post (one last time) what is the output of phpinfo ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

no. Change them all to
url("images/filename.gif");

nav33n 472 Purple hazed! Team Colleague Featured Poster

Nope :( I dont.

nav33n 472 Purple hazed! Team Colleague Featured Poster

No. Just set another environment variable to the temp directory. I have never worked on linux so I dont know how you can set an environment variable in linux, but in windows its pretty simple.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Okay.. I found out your problem. Open css file and change the path of all image urls to images/filename instead of

background-image: url(file:///C|/Documents%20and%20Settings/Azura/Desktop/templete/34/images/nav_on.gif);.

That will solve your problem.
Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

Files will, by default be stored in the server's default temporary directory, unless another location has been given with the upload_tmp_dir directive in php.ini. The server's default directory can be changed by setting the environment variable TMPDIR in the environment in which PHP runs. Setting it using putenv() from within a PHP script will not work. This environment variable can also be used to make sure that other operations are working on uploaded files, as well.

Source: http://alamo.nmsu.edu/computer/references/php_manual_en.html

nav33n 472 Purple hazed! Team Colleague Featured Poster
;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
upload_tmp_dir = "c:/wamp/tmp"

; Maximum allowed size for uploaded files.
upload_max_filesize = 2M

Now that's my php.ini file.Look at the complete path and its within double quotes.

nav33n 472 Purple hazed! Team Colleague Featured Poster

I guess you have. But then, why is upload temp directory 'empty' if you have made correct changes to php.ini file ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

:S Well, you have 2 php.ini files and have specified the temp directory in both those files. But still when you see phpinfo, temp directory is empty. :) Can you tellme what php.ini file is being used by apache ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

umm.. have you changed the temp dir path in php.ini file in the host ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Umm.. I am sorry. I didn't understand. It would be helpful if you post relevant code.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Okay.. The simplest way is, put whatever you want in a variable and print that variable whereever you want. For example,

<?php
$text1="This is some random text ! blah blah blah..<br />I just added a break.";
$text2="One more test.. ";
?>
<html>
<body>
<table>
<tr>
<td>
<?php echo $text1; ?>
</td>
</tr>
<tr>
<td>
<?php echo $text2; ?>
</td>
</tr>
</table>
</body>
</html>

This is just an example. You can do it this way.
Hope that helps.
Cheers,
Naveen

TaoistTotty commented: Great Help +1
nav33n 472 Purple hazed! Team Colleague Featured Poster

okay! now thats a basic html with table and td tags. You forgot to mention "what" you want to update.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Is the news coming from the database ? Do you want to update the news in the database using a frontend ? I am sorry, I still can't understand it. Could you show us the code so that we could understand better ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

It will run the php file present in the IP address(host) you have specified and not the one which is in your local system.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Check the path of the images in your template. Maybe its hardcoded. Welcome to Daniweb btw.

nav33n 472 Purple hazed! Team Colleague Featured Poster

What do you mean by update a html page ? Can you be more specific ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

How will it execute the script in the local system if you give the IP of a remote machine ? :S

nav33n 472 Purple hazed! Team Colleague Featured Poster

What do you mean by 'remote pc' ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

huh! loaded configuration file says no value ? Now that's strange :S !

nav33n 472 Purple hazed! Team Colleague Featured Poster

I wonder why you are still getting header already sent error even after using ob_start and ob_end_flush. But the reason why you get this error is, you shouldn't output anything(not even html tags) to the browser before calling a header function. Instead of header function, use,

echo "<script type='text/javascript'>location.href='$MM_redirectLoginSuccess';</script>";

I guess that will solve the problem.

nav33n 472 Purple hazed! Team Colleague Featured Poster

What does your phpinfo say about the loaded configuration file ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

umm.. I have never worked with linux. But you should make changes to that ini file mentioned in "Loaded Configuration File", because its that configuration file that will be used by apache.

nav33n 472 Purple hazed! Team Colleague Featured Poster

hmm.. Try this.

<?php 
ob_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title>Cycle Tracks Portal - Validation Page</title>
		<style type="text/css" media="all">@import "images/style.css";
</style>
	<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="rss/" />
</head>

<body>
<?php
// connection to MySQL server
mysql_connect('localhost','root','root');
mysql_select_db('administration');

// *** Validate request to login to this site.
//session_start();

if (isset($_POST['username'])) {
  $loginUsername=$_POST['username'];
  $loginPassword=$_POST['password'];
  $MM_redirectLoginSuccess = "validated.php";
  $MM_redirectLoginFailed = "index.html";
  $MM_redirecttoReferrer = true;
  mysql_select_db('administration');
      
  $loginUsername = get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername);
  $password = get_magic_quotes_gpc() ? $password : addslashes($password);
  $LoginRS__query = "SELECT username, password FROM adminprofile WHERE username='$loginUsername' AND password='$loginPassword'";
  
  $LoginRS = mysql_query($LoginRS__query) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
    
    header("Location: " . $MM_redirectLoginSuccess );
	}
  else {
    header("Location: ". $MM_redirectLoginFailed );
}
}
?>

</body>
</html>
<?php 
ob_end_flush(); 
?>
nav33n 472 Purple hazed! Team Colleague Featured Poster

Check for "Loaded Configuration File" in phpinfo and change that file. I think you are changing some other php.ini file !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Execute a script with phpinfo function. Check if the path in upload_tmp_dir is valid. Also check if you have given permissions for the temp directory.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Have you restarted you apache ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

If you have a startup disk(win 98 startup disk), you can boot from floppy, use fdisk to delete the partitions, create new partitions and reinstall windows xp.

nav33n 472 Purple hazed! Team Colleague Featured Poster

you are welcome! and ofcourse, i ll check this thread. I ll be here almost 17 hrs a day. lol.. I hope your code worked! Just in case you didn't find where to put } brace.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title>Cycle Tracks Portal - Validation Page</title>
		<style type="text/css" media="all">@import "images/style.css";
</style>
	<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="rss/" />
</head>

<body>
<?php
// connection to MySQL server
mysql_connect('localhost','root','root');
mysql_select_db('administration');

// *** Validate request to login to this site.
//session_start();

if (isset($_POST['username'])) {
  $loginUsername=$_POST['username'];
  $loginPassword=$_POST['password'];
  $MM_redirectLoginSuccess = "validate.php";
  $MM_redirectLoginFailed = "index.html";
  $MM_redirecttoReferrer = true;
  mysql_select_db('administration');
      
  $loginUsername = get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername);
  $password = get_magic_quotes_gpc() ? $password : addslashes($password);
  $LoginRS__query = "SELECT username, password FROM adminprofile WHERE username='$loginUsername' AND password='$loginPassword'";
  
  $LoginRS = mysql_query($LoginRS__query) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
    
    header("Location: " . $MM_redirectLoginSuccess );
	}
  else {
    header("Location: ". $MM_redirectLoginFailed );
}
}
?>

</body>
</html>

:)

nav33n 472 Purple hazed! Team Colleague Featured Poster

no problem. Put a } before line 40. That will probably solve it.

nav33n 472 Purple hazed! Team Colleague Featured Poster
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title>Cycle Tracks Portal - Validation Page</title>
		<style type="text/css" media="all">@import "images/style.css";
</style>
	<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="rss/" />
</head>

<body>
<?php
// connection to MySQL server
mysql_connect('localhost','root','root');
mysql_select_db('administration');

// *** Validate request to login to this site.
//session_start();

if (isset($_POST['username'])) {
  $loginUsername=$_POST['username'];
  $password=$_POST['password'];
  $MM_redirectLoginSuccess = "validate.php";
  $MM_redirectLoginFailed = "index.html";
  $MM_redirecttoReferrer = true;
  mysql_select_db('administration');
      
  $LoginRS__query=sprintf("SELECT username, password FROM adminprofile WHERE username='%s' AND password='%s'",
  get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password)); 
  $LoginRS = mysql_query($LoginRS__query) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
    
    header("Location: " . $MM_redirectLoginSuccess );
	}
  else {
    header("Location: ". $MM_redirectLoginFailed );
}
?>

</body>
</html>

How come you keep missing one thing or the other :S ! Missing , this time. If this doesn't work, you can try this. It will surely work.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title>Cycle Tracks Portal - Validation Page</title>
		<style type="text/css" media="all">@import "images/style.css";
</style>
	<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="rss/" />
</head>

<body>
<?php
// connection to MySQL server
mysql_connect('localhost','root','root');
mysql_select_db('administration');

// *** Validate request to login to this site.
//session_start();

if (isset($_POST['username'])) {
  $loginUsername=$_POST['username'];
  $password=$_POST['password'];
  $MM_redirectLoginSuccess = "validate.php";
  $MM_redirectLoginFailed = "index.html";
  $MM_redirecttoReferrer = true;
  mysql_select_db('administration');

  $loginUsername=get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername);
  $password=get_magic_quotes_gpc() ? $password : addslashes($password);  
  $LoginRS__query="SELECT username, password FROM adminprofile WHERE username='$loginUsername' AND password='$password'";
  
  $LoginRS = mysql_query($LoginRS__query) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
    
    header("Location: " . $MM_redirectLoginSuccess );
	}
  else {
    header("Location: ". $MM_redirectLoginFailed );
}
?>

</body> …
nav33n 472 Purple hazed! Team Colleague Featured Poster

line 24. $MM_redirectLoginFailed = "index.html; <<< you haven't closed it.
It should have been
$MM_redirectLoginFailed = "index.html";
Use the code that I have posted in previous post. I guess it will work. Your new modified code has a different select query !

nav33n 472 Purple hazed! Team Colleague Featured Poster
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title>Cycle Tracks Portal - Validation Page</title>
		<style type="text/css" media="all">@import "images/style.css";
</style>
	<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="rss/" />
</head>

<body>
<?php
// connection to MySQL server
mysql_connect('localhost','root','root');
mysql_select_db('administration');

// *** Validate request to login to this site.
//session_start();

if (isset($_POST['username'])) {
  $loginUsername=$_POST['username'];
  $password=$_POST['password'];
  $MM_redirectLoginSuccess = "validate.php";
  $MM_redirectLoginFailed = "index.html";
  $MM_redirecttoReferrer = true;
  mysql_select_db('administration');
      
  $LoginRS__query=sprintf("SELECT username, password FROM adminprofile WHERE username='%s' AND password='%s'",
  get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password)); 
  $LoginRS = mysql_query($LoginRS__query) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
    
    header("Location: " . $MM_redirectLoginSuccess );
	}
  else {
    header("Location: ". $MM_redirectLoginFailed );
}
?>

</body>
</html>

There was a missing ". :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

The syntax isnt wrong. Print whats in $MM_redirectLoginSuccess and $MM_redirectLoginFailed. Header function fails if you are outputting ANYTHING before calling a header function.

nav33n 472 Purple hazed! Team Colleague Featured Poster

You dont need $adminprofile. mysql_query takes 2 parameters. 1. The query and 2. The connection resource. The second one is optional.