cwarn23 387 Occupation: Genius Team Colleague Featured Poster

For the actual ram on my main xp installation I have a total of 3250GB and I have assigned 1500GB to the virtual xp installation. I have managed to temporarily close the virtual system to see if that makes a difference but the keybord is still just as slow even though the page file usage drops to normal.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

ya nice input, there is like a few of what i know of that form of validation:
- html
- javascript
- php

Could you explain in more detail and make the question a little more clearer. All that I can tell is that you might want a php and javascript script that might validate a html form. What I don't know is how it's to be validated and what is to be validated and not even sure if that question i pieced together is correct.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi and I have installed some software called virtualbox which is a universal operating system emulator. I have XP Pro and emulated XP Home inside XP Pro but my problem is that my keyboard can only input one key stroke a second. Is it possible that it is because my Page File Usage is 2GB or is it something else. I have 3250GB of Ram so Ram shouldn't be a problem. And my cpu seems to be on about 2%.

Just in case you didn't get my question it is that is it possible the Page File Usage being 2GB causes my keyboard to have a keystroke speed of 1 key per second? If so how can I make the keyboard get a higher priority in the memory or if not then what else could be causing my keyboard to be so slow?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Kinda but if you do use the * symbol (maybe a few others to) then you may want to check what surrounds it because I have heard that there are a few weard combinations that when placed into the date() function it can delete your website. I only briefly came across that but would need to search the web for more info if you would like it. Generally though that should do the trick.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

You can also preg_match a specific set of characters/letters/numbers so that if certain characters are found in the string that should never exist then it would fail the function test. An example is the following that checks if characters other than A-Z a-z 0-9 +-/\* are found. So the example is:

<?
if (preg_match('/[^a-zA-Z0-9+-/\*]/is',$value)) {
return false;
} else {
return true;
}
?>

So to place that in your script it would be the following:

<?
function valid($value) {
mysql_real_escapte_string($value);
if (preg_match('/[^a-zA-Z0-9+-/\*]/is',$value)) {
return false;
} else {
return true;
}
}
?>

So basically you can decide what characters are and are not allowed except for the \ and ^ character which is used in the mysql_real_escape_string. Also note that the ^ character must be right after the bracket.

OmniX commented: Nice code as usual, keep it up! +2
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Or if you don't like the ugly url when using hyperlinks then use sessions. To convert $_POST to $_SESSION simply use the following at the very top of your action.php page:

<?
session_start();
foreach($_POST AS $key => $val) {
$_SESSION[$key]=$val;
}
unset($key);
unset($val);

Then on every page that uses sessions, you need to place session_start(); on the second line with no output before it. And to retrieve a session use the following.

<?
session_start();
//post variable was $_POST['name']
echo $_SESSION['name'];

//post variable was $_POST['age']
echo $_SESSION['age'];
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Also you may want to note that the link identifier is not always optional. An example is if you wanted to connect to multiple accounts then that is when you will need to specify which account to find the database structure in. And to specify which database structure or account that is what the $link_identifier is for. But by default it uses the last connection opened. So as long as you only are only using the mysql_connect() function once you won't need to use the identifier.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I would suggest using curl to tap into another websites currency converter. Let me know if you would like an example as it would be kinda hard to make.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Also don't forget the tizag tutorials at
PHP: http://www.tizag.com/phpT/
MySQL: http://www.tizag.com/mysqlTutorial/

And of course the official documentation for after you know the basic usage of php: http://www.php.net

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Sounds like unless you are using a linux server to compile these exe files, it will make it possible for any good hacker to compile their own code on your server then do all sorts of nasty things to your server. But if you do want to continue, the functions have been mentioned above and use the dos/linux command line depending on which operating system you are using. In case you've forgotten those functions they are:

exec
shell_exec
system
passthru

You will find that all of those functions will function in simular ways and the 2 main ones are exec and passthru. Just don't be supprised if somebody is able to hack the server when performing such operations but I'm sure plenty of people in the 'viruses and other nasties' forum will help if your server is hacked with 1 or more nasties.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

First to make this easier to understand it is the following section of the script that actually transfers the files as the download headers have just been set in that section:

// set headers
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Type: $mtype");
header("Content-Disposition: attachment; filename=\"$asfname\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . $fsize);
 
// download
// @readfile($file_path);
$file = @fopen($file_path,"rb");
if ($file) {
  while(!feof($file)) {
    print(fread($file, 1024*8));
    flush();
    if (connection_status()!=0) {
      @fclose($file);
      REDIRERROR("Unknown error");
    }
  }
  @fclose($file);
}
 
// log downloads
//if (!LOG_DOWNLOADS) REDIRERROR("Enjoy your download");
 
 
//get ip of visitor
if ($_SERVER['HTTP_X_FORWARD_FOR']) {
	$ipv4 = $_SERVER['HTTP_X_FORWARD_FOR'];
} else {
	$ipv4 = $_SERVER['REMOTE_ADDR'];
}
 
if(!AddDownloadLog(intval($idx), strval($ipv4), intval(time())))
{
	$f = @fopen(LOG_FILE, 'a+');
	if ($f) {
  	@fputs($f, date("m.d.Y g:ia")."  ".$_SERVER['REMOTE_ADDR']."  ".$fname."\r\n");
  	@fclose($f);
	}
}
				$counted = false; //has it been added to db?
				$query = "SELECT * FROM " . DB_TNAME_DOWNLOAD . " WHERE " . DB_T_DOWNLOAD_ID . "='$idx'"; //initial query
				$hMySQL = mysql_connect(DB_URL, DB_USERNAME, DB_PASS); //connect
				if($hMySQL) //is it connected?
				{
					//increment download count
 
					if(mysql_select_db(DB_NAME, $hMySQL)) //select db
					{
						$result = mysql_query($query); //query
						if(mysql_num_rows($result) == 1)
						{
							$count = mysql_result($result, 0, DB_T_DOWNLOAD_NUMDOWNLOADED); //get count var
							$count += 1; //increment
 
							$query = "UPDATE " . DB_TNAME_DOWNLOAD . " SET " . DB_T_DOWNLOAD_NUMDOWNLOADED . "='$count' WHERE ". DB_T_DOWNLOAD_ID . "='$idx'";
							//new query
							if(mysql_query($query))
							{
								$counted = true;
							}
						}
 
						mysql_close($hMySQL);
					}
				}
 
				if($counted == false) //was it added to db? if not then add to file for later manual adding
				{
						$f = @fopen(LOG_FILE, 'a+');
						if ($f) { …
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Ok, so why don't we still see apes evolving? Some half man, half ape? What stopped the process? I haven't seen anything lately of it.

Well there has been a case sort of like that during the 18th century when the European settlement took place in Australia. That is if you notice in some countries where people have migrated such as Australia, all the people in Australia before the 18th century were black but after the white people came to Australia and cross bread with the blacks, it then produced mainly white people. So yes there use to be a second type of human species with the same origin before the 18th century but then both species cross bread eliminating most of the blacks. At least that is my opinion on how it happened.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

You have a lot of heavy cell info. there. There is no doubt, the cell is an enormously complex and vital part of the whole life structure on our planet. And more is being discovered, for instance, it's found that the energy that exists in a living cell, manifests as positive and negative, much like electricity. I think it is best to go forward with an open mind and put ones beliefs to the test. Beliefs can be comforting or terrifying, and some of them may be grounded in fact, but belief in no substitute for knowledgel.

Yea. I wonder why those scientest don't test evolution by iscolating living creatures in a controlled environment and see if they adapt to the environment like evolution suggests. That would save the time and effort at looking for fossles to prove evolution.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

See the exec/shell_exec/system commands.

Also note that I find these functions are a use at your own risk type functions because they can cause some servers to crash when security is tight on the server. And that includes the passthru function.

But running exe's with php, don't you think in the long term it would work out better to convert the exe's to php weather you find a converter or reprogramming it in php. The reason why I comment on that is what would be a possible use of running exe's remotely from a website. Seems like too much of a security problem to me.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

In addition you have an extra closing bracket on the first line and your mysql query's need escaping. Try making your code the following:

<?php
$dbcnx = mysql_connect("localhost","user_name","password");
if (!$dbcnx){
exit('<p>Unable to connect to the database</p>');
}
if (isset($_POST['submit']))
{
$SchoolName = mysql_real_escape_string($_POST['SchoolName']);
$SchoolEmail = mysql_real_escape_string($_POST['SchoolEmail']);
$UserName = mysql_real_escape_string($_POST['UserName']);
$pscode = mysql_real_escape_string($_POST['pscode']);
 
$sql = mysql_query('INSERT INTO accesscarduse (SchoolName, SchoolEmail, UserName, pscode) 
VALUES ("'.$SchoolName.'", "'.$SchoolEmail.'", "'.$UserName.'", "'.$pscode.'")') or die(mysql_error()); 
}
echo 'Values successfully submitted to database. Thank you';
?>

Just a note, it has also been suggested on another topic that using single quotes wherever possible will speed up execution time.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Also I still haven't heard of the results for when you try to open a page with only the following code:

<?
session_start();
?>

That will say if it is your editor.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

hi gagan,
pls send ur (session_start) thread url...

Did you mean this one: http://www.daniweb.com/forums/thread177977.html

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

What about putting it into a if statement like the following:

if (mail($to,$subject,$message,$headers)) {
//message sent
} else {
//message failed to send
}

Also if you want to check each email individually then you can put the mail function inside a foreach loop.

veledrom commented: Good idea +1
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I have just checked your script and it appears your script is fine but looks more like if the entries in your database are not. Make sure the file locations in the database match the file locations in the file system. So in your script the downloads will be performed in www.yoursite.com/folder_script_is_in/__file__downloads/filename.zip

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Simple...
Just allow the email to have html formatting then place an invisible iframe that links to your website and you can then use that iframe to use $_GET to say that the email has been recieved. An example is the following:

<iframe width=1 height=1 src='http://www.yousite.com/email.php?id=195'></iframe>

So when your email.php file recieves that $_GET command it then knows that the email with the id 195 has been opened. And of course you will need to keep a database of which id's are associated with which emails.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Sha1 encryption. Personaly I like to take a more secure approach. Below are two hash functions which are way more secure:

function truehash($hashzzz) {
return hash('crc32b',hash('whirlpool',$hashzzz));
}
/* below hash function is more
   secure but takes more cpu.      */
function securehash($hashzzz) {
return hash('crc32b',substr(hash('whirlpool','asdf'.$hashzzz.'a'),64));
}

So try one of those to hash functions or something not in the ordinary. Also for site security, it is best if you don't place the password/hash inside a session.

Also when designing a login system, you will probably want a flood filter. That means that a computer can only have so many attempts to login then they will be blocked for an hour. And when designing that system, instead of using cookies or sessions, use databases and ip addresses. I have also heard that passwords are getting old, so maybe have a visual validation too. Example: A picture of an apple and the user needs to select apple from the menu.

That is all I can think of right now but would like to see peoples comments on this.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Also change $to = "mymail@anydomain.com"; to your real email. In addition, another possible error which I am unsure if exists is that the if element may need to be as follows:

if (mail($to,$subject,$message,$headers))
{
mail($to,$subject,$message,$headers)
echo "Mail Sent.";
}

But I am unsure about if element and have never known if the mail function will work in the if element.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

thanks for reply,
I have also tried this as u told me. I have changed the <? tag to <?php also .Still the problem is same . pls help me . how i can solve this.

thanks,

Try making a file using your normal editor and type the following code in it to see if it reports an error.

<?
session_start();
?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

hey... y u copied... and pasted without any comments (my code)

It appears he didn't really copy your code but instead quoted your post.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Hi vinoth,

I want to discuss with you . because i am facing one problem which i have already discussed in this forum session_start warning . please help me . i have done every effort for solving that warning.
pls help me if u can solve this.
thanks ,
gagan

Did you check my post on http://www.daniweb.com/forums/thread177977.html
I have found numerous topics on both daniwebs and PHPfreaks in the past and two main reasons are the editor adds a hidden string at the beginning and the second being that there is something before <? tag. I believe some have even tried using <?php instead of <? or vice versa and is then successful.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

//while clicking download button do this process
$content - should have the content like
$content = "<table><tr><td>val1</td><td>val2</td></tr></table>";

header('Pragma: anytextexeptno-cache', true);
header("Content-type: application/vnd.ms-excel");
header('Content-Transfer-Encoding: Binary');
header('Content-disposition: attachment; filename='myfile.xls');
print $content;

You have that backtofront. Unusally it is more like the following as quoted from an earlier post:

<?
$content - should have the content like
$content = "<table><tr><td>val1</td><td>val2</td></tr></table>";
echo $content;
header('Pragma: anytextexeptno-cache', true);
header("Content-type: application/vnd.ms-excel");
header('Content-Transfer-Encoding: Binary');
header('Content-disposition: attachment; filename=myfile.xls');
?>
</p>
</body>
</html>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

BTW, just to give you an idea of where Murtan is talking about (not very obvious) it is the following line of the second file where value=

<input type = "radio" name = "gender" value = ""/>Both

As you can see there is no value assigned to that field and that is why it will appear as empty in the database.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

If you want to extract the url's from the page then I have an existing script that not only extracts to links to other pages but also links to pictures and other media. My script is as follows:

function getlinks($url) {
    $media=preg_split('/(href\=\"|href\=\'|href\=|src\=\"|src\=\'|src\=)/i',$url);
    $media=preg_replace("/([^\'])\'(.*)/is",'$1',$media);
    $media=preg_replace("/([^\"])\"(.*)/is",'$1',$media);
    $media=preg_replace("/([^\>])\>(.*)/is",'$1',$media);
    $media=preg_replace("/([^\'])\'(.*)/i",'$1',$media);
    $media=preg_replace("/([^\"])\"(.*)/i",'$1',$media);
    $media=preg_replace("/([^\>])\>(.*)/i",'$1',$media);
    $media=preg_replace("/([^ ])\ [0-9\'\"\>\/](.*)/is",'$1',$media);
    $media=@preg_replace("/([^ ])\ [0-9\'\"\>\/](.*)/i",'$1',$media);
    $mediaext=preg_replace("/.*[.]([^.]+)/",'$1',$media);
    return $media;
    }
//above function returns an array

May be badley written but does the job. So I shall see if I can do a preg_match function.

=======================
Edit:
I have now written a function that will extract the links more efficiently and is as follows:

<?
function getlinks($url) {
    $data=file_get_contents($url);
    preg_match_all('/(href|src)\=(\"|\')[^\"\'\>]+/i',$data,$media);
    unset($data);
    $data=preg_replace('/(href|src)(\"|\'|\=\"|\=\')(.*)/i',"$3",$media[0]);
    return $data;
    }

//now to use the function
echo "<xmp>";
var_dump(getlinks('http://www.google.com.au'));
echo "</xmp>";
?>

And the function as you can see returns an array of the links.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

while using double quotes.. parser will search for php variable("my name is vinoth" instead use 'my name is vinoth') inside that string...(execution/parsing time will be greater). If we want to display the string with out any php variable('my name is '.$name)... then better to use single quotes...
its truth.... in PHP (I may not know about other languages)

I can understand that when assigning a value to a variable/array that would be true but would it be the same with a mysql query. An example is the following:

$var="line1\nline2";
mysql_query('INSERT INTO `table` SET `column`="'.$var.'"');

Would that record the following:

line1
line2

Sort of a tricky thing when mixing two syntaxs together because you are unsure which syntax will be the one that will take place.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

All animal and vegetable organisms, even the most primative, are composed of cells that grow, devide, die and renew themselves, and demonstrate an intelligence in the way they build repair the organism, and recact to changes in their environment.

I am not sure what you are trying to say here - are you implying that individual cells are intelligent?

I think in science it is widely known that all cells are intelligent. From what I have learn't from a Biology course, each cell has programmed into it a set of instructions. For example, a human airborn virus is basically a bunch of cells programmed to infect other cells to enter the system. Example, if the virus first infects the blood cells like a lot of viruses do, it will get into your system quicker. That is when our immune system gets into place destroying nasty cells and some of its surrounding cells. While the immune system is at work, the virus attempts to effect parts of the body where it can then spread to other humans while doing whatever it was programmed. Some might say this is an effect of creationism where an agent created a virus but I believe it is more likely to be a effect of evolution where somebody sneases then the bacteria that sneasing creates then grows until it form new life or in the above example a virus.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

arrays is a good idea, but then requires alot of manuel work, of constantly updating the code when there is a new image. Unless you do it atuomaticaly but your script does not support that.

What I posted was just what the user wanted. However, there are 2 alternative options. There is the option of php automatically detecting the pictures in the folder and assign them to an array (requires a bit of cpu) or another option is to fetch the arrays from a mysql database.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Well I don't know you database structure (column names) but first step is to make the data output like the below. After you make a php file with the output like the below, then I shall show you how to add the headers to download as a excel file. The headers are also shown in the example above (previous post).

<table cellspacing='4' cellpadding='4' border=1 align=center>
<tr>
<td>Date</td>
<td>Day</td>
<td>TimeIn</td>
<td>TimeOut</td>
<td>TotalTime</td>
<td>Status</td>
</tr>
<tr>
<td>2009-02-23</td>
<td>Monday</td>
<td>10:11:18</td>
<td>19:38:22</td>
<td>9.27 Hours</td>
<td>O.K.</td>
</tr>
<tr>
<td>2009-02-24</td>
<td>Tuesday</td>
<td>10:09:52</td>
<td>20:06:27</td>
<td>9.56 Hours</td>
<td>O.K.</td>
</tr>
<tr>
<td>2009-02-25</td>
<td>Wednesday</td>
<td>10:04:13</td>
<td>18:52:28</td>
<td>8.49 Hours</td>
<td>O.K.</td>
</tr>
<tr>
<td>2009-02-26</td>
<td>Thursday</td>
<td>09:56:55</td>
<td>19:52:56</td>
<td>9.56 Hours</td>
<td>O.K.</td>
</tr>
<tr>
<td>2009-02-27</td>
<td>Friday</td>
<td>10:08:51</td>
<td>18:00:00</td>
<td>09 Hours</td>
<td>O.K.</td>
</tr>
<tr>
<td>2009-02-28</td>
<td>Saturday</td>
<td>10:06:13</td>
<td>19:50:34</td>
<td>9.44 Hours</td>
<td>O.K.</td>
</tr>
</table>

Just a note, I noticed the link I provided didn't work so the update is: http://www.daniweb.com/forums/thread91019.html

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Try the following:

$string='seaweed#';
$strb=explode('#',$string);
$strb[0]=str_replace(array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'),array('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26'),$strb[0]);
$newstring=$strb[0].'#'.$strb[1];
echo $newstring;
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

You could also just store the image names in an array and refer to the array with the number. An example is the following.

<?php
function image()
    {
    $min = 1; //The first number one of your images has
    $max = 3; //The highest number you image has
    $num = rand($min, $max);
    //set picture names
    $pic[1]='firstpic.jpg';
    $pic[2]='secondpic.jpg';
    $pic[3]='another_name.jpg';
    //end of setting picture names
  $url = "http://website.com/~ub/_ubr/wp-content/themes/ubcmi/images/icons/" .$pic[$num]."; //change the url to your url //for the image split the url into two parts by separating in between the image name and //extension
	echo "<img src='$url'>";
}
 ?>

Very basic and hope it does the job.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

There is a topic about it at http://www.daniweb.com/forums/showthread.php?t=91019&highlight=excel
It basically says to use the excel html formating like when you export html file from excel. Also it quotes the following code:

<?php


echo "<table cellspacing='4' cellpadding='4' border=1 align=center>";
echo"<tr>";
echo"<td>Day</td>";
echo"<td>Time</td>";
echo"<td>Unit</td>";
echo"<td>Lecturer</td>";
echo"</tr>";

echo"</table>";















header("Content-type: application/octet-stream");

# replace excelfile.xls with whatever you want the filename to default to
header("Content-Disposition: attachment; filename=excelfile.xls");
header("Pragma: no-cache");
header("Expires: 0");


?> 
  
  
</p>
</body>
</html>

Hope that helps.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

By the looks of the location it seems you are using wamp and when accessing the files under localhost the permissions shouldn't make a difference. Another thing, are you using notepad? If not then open the file in notepad then delete the first line without the mouse and replace the first line. By saying without the mouse, I mean to click at the end of the line then to hold down the keyboard backspace key for about 5 seconds or untill you hear a constant beaping noise. Then retype in the first line in notepad. BTW notepad is a program that comes with windows. Then save the file and see if that works. The reason is that this issue can be because your text file editor is adding extra binary data to the beginning of the file and notepad will be able to detect this binary data weather it is as invisible characters or weared symbols. Another way to test if this is the case is to make a file with the following using your regular editor and see if it too reports an error:

<?
session_start();
?>
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Could you attach the xml file to your next post so that I could check the code and clean up the code a bit (and add those extra features).

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

-- save this file as index.php and try it out.....

I just saved it as index.php and ran it on xampp and it runs accordingly to what the script design appears to be. So could you please express your scripting problem?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

To be a better php programmer always use single quotes like this,
mysql_query('DELETE FROM user_notifications WHERE username="'.mysql_real_escape_string($acc).'" AND notification="'.mysql_real_escape_string($note2).'"')
or die(mysql_error());
bcoz: php parser will search and parse full string while using double quotes. :) - might look simple - but usefull tip(i think so)

From what I have read in the past that is only a c++ thing. In c++ single quotes represent a single character where as with php, single quotes simply just doesn't apply new lines or returns (eg \n\r). Instead it will just display them as their literal characters. Where as double quotes in php allow those returns to be displayed instead of their literal characters. So you may find with your method that your returns will not turn out!!!

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

mysql_query("DELETE FROM user_notifications WHERE username='".$acc."' AND notification='".$note2."' "); that should be fine. if its not, try checking your $acc and $note2 variables...

You also need to escape the variables like this:

mysql_query("DELETE FROM `user_notifications` WHERE `username`='".mysql_real_escape_string($acc)."' AND `notification`='".mysql_real_escape_string($note2)."' ") or die(mysql_error());
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Also it would probably be better to use strlen() or empty() to determine if there is no value to the array. Script should look like following:

$sql = "SELECT * FROM `list` WHERE `title` LIKE '%".$search[0]."%' AND `url` LIKE '%".$sites[0]."%'";
 
$catcnt = mysql_fetch_row(mysql_query($sql));
 
if(empty($catcnt[0]))
{ 
header('Location: index.php');
}
else{
echo $catcnt[0];
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

...
here is my php code, pleas help me check it and tell me how to make it works.
...

What seems to be the problem. Do errors get reported or does it not function properly. If so how is it not functioning properly or what errors are reported?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

use phpmailer. you cannot set a password in the ini for mail(). that is the problem. you can set it with phpmailer. very easy to use.

Yes, it appears that if you want to be able to use the mail function then you need to setup the computer running the script as a mail server. I wonder how you would over-come this on php-gtk?

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Check the file size that is downloaded. If it is 0Kb then you will find that your script is not specifying the correct location. Other than that I don't have a clue as the syntax used in your code is a bit hard to read.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

that above code doesnot working,,,

tell me any simple method so that it will display Your details , your business title ....

Well that probably means that a- you haven't placed the foreach loop in my previous post in all 5 files or b- you did not use the html field names inside the session array or c- you did not put session_start() at the beginning of all 5 files.

If you want a simpler method then first you may want to remove the foreach loop mentioned in my previous post from all your pages. Then place session_start(); at the top of all of your pages if it does not allready exist. After that place the following code on the next line below session start on page 2:

foreach($_POST AS $keyzz => $valzz) {
$_SESSION['aa1'][$keyzz]=$valzz;
}

Then line below session start on page 3:

foreach($_POST AS $keyzz => $valzz) {
$_SESSION['aa2'][$keyzz]=$valzz;
}

Then line below session start on page 4:

foreach($_POST AS $keyzz => $valzz) {
$_SESSION['aa3'][$keyzz]=$valzz;
}

Then line below session start on page 5

foreach($_POST AS $keyzz => $valzz) {
$_SESSION['aa4'][$keyzz]=$valzz;
}

In case you are wondering, page 1 is the first form page and page 2 is second page which has had $_POST submitted to it untill page 5 which display or whatever the results while receiving the posts. Now for the message, the following will do the trick:

$body="title1 \n";
foreach($_SESSION['aa1'] AS $keyaa => $valaa) {
$body.="$keyaa : $valueaa \n";
}
unset($keyaa);
unset($valaa);
$body="title2 \n"; …
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

I also found a useful link at http://stackoverflow.com/questions/36079/php-mail-using-gmail but it requires an extension library.

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Is that real?!
Nice movie especially the end bit when the person runs through the wall with a nice trip. By saying trip I mean falling over. lol

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

below is a way of assigning each value to the variable but replace the term html_field_name with the name of the html field.

$message="YOUR DETAILS

title : ".$_SESSION['html_field_name']."
name : ".$_SESSION['html_field_name']."
lname : ".$_SESSION['html_field_name']."
address : ".$_SESSION['html_field_name']."
pin : ".$_SESSION['html_field_name']."
country : ".$_SESSION['html_field_name']."
contact : ".$_SESSION['html_field_name']."
email : ".$_SESSION['html_field_name']."


YOUR BUSINESS

business : ".$_SESSION['html_field_name']."
type : ".$_SESSION['html_field_name']."
product : ".$_SESSION['html_field_name']."
staff : ".$_SESSION['html_field_name']."
checkbox : ".$_SESSION['html_field_name']."
checkbox2 : ".$_SESSION['html_field_name']."
checkbox3 : ".$_SESSION['html_field_name']."
checkbox4 : ".$_SESSION['html_field_name']."
checkbox5 : ".$_SESSION['html_field_name']."

YOUR WEBSITE

radio : ".$_SESSION['html_field_name']."
color : ".$_SESSION['html_field_name']."
webpage : ".$_SESSION['html_field_name']."
hosting : ".$_SESSION['html_field_name']."
account : ".$_SESSION['html_field_name']."
web1 : ".$_SESSION['html_field_name']."
like : ".$_SESSION['html_field_name']."
web2 : ".$_SESSION['html_field_name']."

like2 : ".$_SESSION['html_field_name']."
brand : ".$_SESSION['html_field_name']."
images : ".$_SESSION['html_field_name']."
text : ".$_SESSION['html_field_name']."

lang : ".$_SESSION['html_field_name'];

Also if that doesn't work, make sure the following code is in tack on all pages that receive the $_POST.

foreach($_POST AS $keyzz => $valzz) {
$_SESSION[$keyzz]=$valzz;
}
cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Simply add them manually (script wise) to the $message variable. If you like, you can post what you have assigned to the $message variable and I shall correct it to the above design for you!

cwarn23 387 Occupation: Genius Team Colleague Featured Poster

Are you talking about the email title/subject or webpage titlebar? Below is an example of both cases:

mail($1, $title, $3); //mail title
echo "<head><title>$title</title></head>";//html title bar