I am currently using this php code to send a mail from a form on my website, and it works fine, with one exception : when we receive the email it shows as sent by "webmaster@mydomain.com" instead of the user's email.  This is the php :  if(isset($_POST["submit"])){ // Checking For Blank Fields.. if($_POST["vname"]==""||$_POST["vemail"]==""||$_POST["vphone"]==""||$_POST["msg"]==""){ echo "Fill All Fields"; }else{ // Check if the "Sender's Email" input field is filled out $email=$_POST['vemail']; // Sanitize E-mail Address $email=filter_var($email, FILTER_SANITIZE_EMAIL); // Validate E-mail Address $email=filter_var($email, FILTER_VALIDATE_EMAIL); if (!$email){ echo "Invalid Sender's Email"; } else{ $subject = "Contact site"; $message = "\n\nMessage from: ".$_POST["vname"]."\nPhone: ".$_POST["vphone"]."\nEmail: ".$_POST["email"]."Message:\n\"".$_POST["msg"]."\""; $headers = 'From:'. $email . "\r\n"; // Sender's Email $headers .= 'Cc:'. $email . "\r\n"; // Carbon copy to Sender $message = wordwrap($message, 70); // Send Mail By PHP Mail Function mail("contact@mydomain.com", $subject, $message, $headers); echo "Email sent !"; } } }
I am using PHP with Apache on Linux, with Sendmail. I use the PHP  function. The email is sent, but the envelope has the Apache_user@localhostname in MAIL FROM (example nobody@conniptin.internal) and some remote mail servers reject this because the domain doesn't exist (obviously). Using mail, can I force it to change the envelope MAIL FROM?  EDIT: If I add a header in the fourth field of the mail() function, that changes the From field in the headers of the body of the message, and DOES NOT change the envelope MAIL FROM.  I can force it by spawning sendmail with sendmail -t -odb -oi -frealname@realhost and piping the email contents to it. Is this a better approach?  Is there a better, simpler, more PHP appropriate way of doing this?  EDIT: The bottom line is I should have RTM. Thanks for the answers folks, the fifth parameter works and all is well.
Prison problem: locking or unlocking every $n$th door for $ n=1,2,3,...$ I have a problem called "The Prison Problem" that I need to explain to my 9-year-old cousin. I would think that he has just started learning about divisors and perfect squares, and as such, I have a proposed solution. Any input from you guys would be welcome, as to what is the best way to go about this.  Problem:  There was a jail with 100 cells in it, all in a long row. The warden was feeling very jolly one night and told his assistant that he wanted to give all the prisoners a wonderful surprise. While they were sleeping, he wanted the assistant to unlock all the cells. This should be done, he told the assistant, by putting the key in each lock, turning it once. The assistant did this, then came back to report that the job was done. Meanwhile, however, the warden has second thoughts. "Maybe I shouldn't let all the prisoners free," he said. "Go back and leave the first cell open, but lock the second one (by putting the key in and turning it once). Then leave the third open, but lock the fourth, and continue in this way for the entire row." The assistant wasn't very surprised at this request as the warden often changed his mind. After finishing this task, the assistant returned, and again the warden had other thoughts. "Here's what I really want you to do," he said. "Go back down the row. Leave the first two cells as they are, and put your key in the third cell and turn it once. Then leave the fourth and fifth cells and turn the key in the sixth. Continue down the row this way." The assistant again did as instructed. Fortunately, the prisoners were still asleep. As a matter of fact, the assistant was getting pretty sleepy, but there was no chance for rest yet. The warden changed his mind again, and the assistant had to go back again and turn the lock in the fourth cell and in every fourth cell down the row. This continued all through the night, next turning the lock in every fifth cell, and then in every sixth, and on and on, until on the last trip, the assistant just had to turn the key in the hundredth cell. When the prisoners finally woke up, which ones could walk out of their cells?  Proposed solution:  Ten cells are left open after this process. Every cell that is a perfect square will remain open (1, 4, 9, 16, 25, 36, 49, 64, 81, and 100). If a number is not a perfect square, then it has an even number of divisors, therefore it will be "toggled" an even number of times and end up where it started (closed). Perfect squares have an odd number of divisors, so they will end up the opposite of where they started (open). read only access to all files in a specific sub-folder I have got a specific folder located in "/home/.../reboot/".  I have a series of users that require read-only access to the ever changing files within.  My problem is that the same users are not authorized to view any of the parent directory files.  Right now, the only thing I have in place is that their starting folder is at "/home/.../reboot/" by changing the etc/passwd file; and I need to block all access to other folders.  How could I only give them access to this directory? I need to make Windows 7 STOP disabling the wifi adapter when the wired LAN is connected Singular verb after two noun phrases joined by "and" that can be thought of as a single thing I am having trouble with the following sentence:      "The complexity and diversity of the new platforms is worrying us."   If "complexity" and "diversity" constitute two subjects, then the verb should presumably be "are"; however, the sentence feels more natural with "is". Is this correct? Is there a linguistic term for this occurrence?    The following questions address the general topic of compound subjects, but not specific cases like this:             And the following question seems to have somewhat inconclusive answers:         So this question is not really a duplicate of these three. Number of connected components of the complement of a compact Let $X$ be a connected, locally compact space and let $K$ be a compact subset of $X$. Is the number of connected components of the complement $X\setminus K$ finite? If it is not, are there some hypotheses over $X$ for finiteness of connected components? If $F:M\to N$ is a smooth embedding, then so is $dF:TM\to TN$. How to get the type of T from a member of a generic class or method What is an English adjective that means "able to learn new things quickly"? Why are some genes dominant over others? What is the mechanism behind it? If I have a brown eye gene which encodes the protein that is responsible for the brown color and have a blue eye gene as well, what is the reason that my eye color is brown? How does one gene maintain dominance over the other? How to set a different input method for each app window How can I have a different input method for each app window on windows 8. When I change input language to ENG all app window also uses this method and I don't want that. Like windows 7 that has a different input method for this purpose. thanks Unknown error: '' ("The cache has no package named wine-staging-i386") How to access new colour schemes in version 10? How to create a .deb file with dependency? I have a game made with the LÖVE framework and I want to package it into a .deb file so it can be easily installed by others and be easily findable through the Unity dash for example.   I also have the LÖVE framework love_0.7.2.deb which I want to be in the deb file also somehow.  Files that I have:  game_icon.png game .desktop the_game.love love_0.7.2.deb   Could someone explain to me how to do this? Understanding backtick (`) Another way to evaluate $\int\frac{\cos5x+\cos4x}{1-2\cos3x}{dx}$? What I've done is this:$$\int\dfrac{\cos5x+\cos4x}{1-2\cos3x}{dx}$$ $$\int \dfrac{\sin 3x}{\sin 3x}\left[\dfrac{\cos5x+\cos4x}{1-2\cos3x}\right]{dx}$$ $$\dfrac {1}{2}\int\dfrac{\sin 8x -\sin 2x +\sin 7x -\sin x}{\sin 3x - \sin 6x}$$ $$-\dfrac {1}{2}\int\dfrac{ \sin \frac{7x}{2} +\sin \frac{5x}{2} } {\sin \frac{3x}{2} }$$ $$-\int\dfrac{ \sin {3x}\cos \frac{x}{2} } {\sin \frac{3x}{2} }$$ $$-\int\dfrac{2\sin \frac{3x}{2} \cos \frac{3x}{2}\cos \frac{x}{2} } {\sin \frac{3x}{2} }$$ $$-\int {2\cos \frac{3x}{2}\cos \frac{x}{2} }$$ $$ -\left(\frac{\sin 2x}{2} +\sin x \right) +c $$ Is there any other way to do so ? Is it possible to do it by substitution ? Can Windows 7 be repaired to run with new motherboard? I have HP computer and it came with Windows Vista. It also had an option to upgrade to Windows 7 via upgrade disc. I have upgraded to Windows 7 via the special upgrade disc (It is special because it will only allow to install Windows 7 if Vista is already installed.  My motherboard recently died. I just replaced it and Windows 7 will not start up. It reboots and sometimes gives a blue screen of death. Very similar problem as described in this post: . Windows will not boot into normal or safe mode. Start up repair from system repair disc does not fix the problem. However, "" post on superuser describes that it should be possible to run Windows 7 on a new motherboard.  Is it hopeless to find a way to repair Windows 7 and I need to do a clean install? Is there a difference for repair options between OEM and retail versions of Windows 7? I remember doing this type of repair just fine in Windows XP days, so why am I unable to do so with Windows 7 - is it Microsoft or HP's fault? Should I stop buying HP computers or should I switch to Ubuntu? Is it ok to answer based someone's older answer on SE? Possible Duplicate:             This question will probably be closed in a few minutes. It is a duplicate but I couldn't find the question using with meta search.  Anyway, , . In this case, is vote to close the new question as a possible dublicate not the best choice? Looks to me a little bit not ethical. Any solutions to Veritasium's hydrodynamic levitation? So this Youtube video has been around for a while now  . Also this  may be related.  I just wanted to know if there is any standard hydrodynamic terms to explain it. Derek clearly states it is not about Bernoulli principle, as in this case the ball rotation is important.  Has any recent paper/videos discussed what happens if you do the same experiment with hydrophobic spheres? Can it be predicted with laminar flow theories or does it need turbulence?  Too many questions have been posed, but not so many responses on the internet yet.  Edit: I said Derek stated "it wasn't Coandă effect", yet what he says is that it is not "just Bernoulli's principle". Coandă effect is the typical hairdryer ping-pong ball levitation which is explained by Bernoulli's principle.   Edit2: rephrasing.  Additional comment: There seems to be two explanations "water adhere to the sphere and is ejected conserving horizontal momentum" and "Magnus effect" (ME). The later is not so obvious to me as the system is in equilibrium and there are two fluids, water and air, (does ME means air pushes the ball horizontally?).   Edit3: DESCRIPTION To avoid rot links and people that do not want to see the video, I'll try to explain the phenomena. You have a sphere and a water jet. The water jet is vertical (opposite to gravity), and touches the sphere almost tangentially. The ball not only rotates due to the water jet but also stays at constant height from the ground. The angular velocity can be defined in the direction of the cross product between the position of the contact point between the jet and the sphere (origin in the center of the sphere) and the direction of the jet. Some water drops fly away at the top of the sphere away from the jet.  Edit4: New question, would this phenomenon occur if there was no air? Google Analytics: How can I track between http:// and https:// profiles for a domain? Is Meta Stack Overflow just the meta for Stack Overflow or is it a somewhat special meta site? Initially I thought that Meta Stack Overflow was the common meta for all SE sites.   Then I noted that  has its own meta site.   It took a while for me to learn that even Server Fault has its own meta site.  Looking at my reputation points, I see difference between Stack Overflow and Meta Stack Overflow, but not between the other sites and there corresponding meta sites.  Now, is Meta Stack Overflow in some sense the master meta site of all or not?