PHP - Moved: Text Input Such As Hotmail To:...
This topic has been moved to Miscellaneous.
http://www.phpfreaks.com/forums/index.php?topic=344655.0 Similar TutorialsThis topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=357414.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=319994.0 Hi people, I really hope you guys can help me out today. I'm just a newbe at php and i'm having real trouble. Bassically all I want to do is have a user type in a company name in a html form. If what the user types in the form matches the company name in my php script i want the user to be sent to another page on my site. If what the user types in the form doesnt match the company name in my php script i want the user to be sent to a differnt page like an error page for example. this is my html form: Code: [Select] <form id="form1" name="form1" method="post" action="form_test.php"> <p>company name: <input type="text" name="company_name" id="company_name" /> </p> <p> <input type="submit" name="button" id="button" value="Submit" /> </p> </form> And this is the php code I'm trying to process the information on: Code: [Select] <?php $comp_name = abc; if(isset ($_POST["company_name"])){ if($_POST["company_name"] == $comp_name){ header("Location: http://www.hotmail.com"); exit(); } else{ header("Location: http://www.yahoo.com"); exit(); } } ?> The thing is i'm getting this error when i test it: Warning: Cannot modify header information - headers already sent by (output started at D:\Sites\killerphp.com\form_test.php:10) in D:\Sites\killerphp.com\form_test.php on line 17 Please can some one help me out, i'm sure this is just basic stuff but i just cant get it to work Cheers. Hi i have this edit form that allows user to mofy data but the problems on the text box is that it deletes the rest of the data after the space from the first word i tried to increase the size of the varChars on mysql but did no work why it happens how can i stop from happening?? this the form input <input type="text" name="name" id="name" class='text_box' value="<?php echo $_GET['name'];?>"/> I'd like to use a text editor like this one: http://tinymce.moxiecode.com/examples/full.php for my forums. But I am not sure exactly how I would prevent abuse and injects to messed up the page, rather than being contained in the designated area it is meant for. Could some one please help me, I know htmlspecailchars will not work, since some of the code needs to render as html i think because of my code used to send the mail, on my site, its appearing in the spam folder of most of my clients PLUS myself is their a way to eradicate this? correct headers? etc? I am looking for a script that is used in Facebook. Wherein, user enters the email address and password and the system will automatically fetch the addresses from the address book of Hotmail or Gmail etc and sends invitation to join the site network. Do you have any link for such a script that comes free. Looking forward to that. Thanks, Faisal Alright so I have 3 pages. Signup, Password reset and Send message. All three pages/forms email to the recipient.
So far my test have only been with hotmail and gmail.
All emails go through for hotmail accounts. They show up in the hotmail.
All emails DO go through for gmail accounts. But they don't show up in the gmail. The only page that gmail is able to receive emails from is "send message". The emails derived from that send message show up in gmail. The other two don't.
There are not errors on the server side that show up. It clearly shows emails being sent.
Does anyone have a clue why this is happening?
Edited by man5, 23 August 2014 - 03:48 PM. Has anyone ever used these. I want to develop a tool so users of my site can invite there friends. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=330084.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=306489.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=317004.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=342456.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=318062.0 I'm new to PHP So sorry if this is a nooby question, But i have 3 php pages, one asks for username, pass, database and host, and then posts it on the next php page. The next PHP Page asks if all the information is correct, with hidden inputs, and the values as the PHP settings, but wrapped in <?php ?> Example: <input type="hidden" name="user" value=<?php $user; ?> /> Will the above set the value of user to the PHP Value of $user? In a simple text field in a form.... the browser automatically offers a list, when either when you click in or start typing in the field, of previous entries. My question is: Does anyone know how to control this? Is it possible to give a list of values to the browser, sort of like a ajax search, but all sent before. For example; in one field the user must enter a name, i want the text box to offer name possibilities even before the user has entered any on the form previously... sort of combining the <text> with a <select> menu... with all the name possibilities coming from a mysql table Help guys!!! Basically i want to return/display User OS info/name from input field... Below my unfinished scripts.. <?php $user_agent = $_SERVER['HTTP_USER_AGENT']; function getOS() { global $user_agent; $os_platform = "Unknown OS Platform"; $os_array = array( '/windows nt 6.2/i' => 'Windows 8', '/windows nt 6.1/i' => 'Windows 7', '/windows nt 6.0/i' => 'Windows Vista', '/windows nt 5.2/i' => 'Windows Server 2003/XP x64', '/windows nt 5.1/i' => 'Windows XP', '/windows xp/i' => 'Windows XP', '/windows nt 5.0/i' => 'Windows 2000', '/windows me/i' => 'Windows ME', '/win98/i' => 'Windows 98', '/win95/i' => 'Windows 95', '/win16/i' => 'Windows 3.11', '/macintosh|mac os x/i' => 'Mac OS X', '/mac_powerpc/i' => 'Mac OS 9', '/linux/i' => 'Linux', '/ubuntu/i' => 'Ubuntu', '/iphone/i' => 'iPhone', '/ipod/i' => 'iPod', '/ipad/i' => 'iPad', '/android/i' => 'Android', '/blackberry/i' => 'BlackBerry', '/webos/i' => 'Mobile' ); foreach ($os_array as $regex => $value) { if (preg_match($regex, $user_agent)) { $os_platform = $value; } } return $os_platform; } function getBrowser() { global $user_agent; $browser = "Unknown Browser"; $browser_array = array( '/msie/i' => 'Internet Explorer', '/firefox/i' => 'Firefox', '/safari/i' => 'Safari', '/chrome/i' => 'Chrome', '/opera/i' => 'Opera', '/netscape/i' => 'Netscape', '/maxthon/i' => 'Maxthon', '/konqueror/i' => 'Konqueror', '/mobile/i' => 'Handheld Browser' ); foreach ($browser_array as $regex => $value) { if (preg_match($regex, $user_agent)) { $browser = $value; } } return $browser; } $user_os = getOS(); $user_browser = getBrowser(); $device_details = "<strong>Browser: </strong>".$user_browser."<br /><strong>Operating System: </strong>".$user_os.""; print_r($device_details); //detail //echo("<br /><br /><br />".$_SERVER['HTTP_USER_AGENT'].""); ?>Above scripts works well when I run it... It will display my OS version But the problem it is, I want to create an input field so user can key in any IP address and the scripts above will display the OS info/name if valid else invalid... Above scripts use.. $user_agent = $_SERVER['HTTP_USER_AGENT']; that automatically display OS info/name... But I want manually key in the IP from input field and the scripts above will display correspond OS info/name from the input field... how to change scripts above...especially $user_agent = $_SERVER['HTTP_USER_AGENT']; so it can return IP address from input field?? I`m greatly honor if you guys would like to help out.. Hello, I have a script that displays that uses a while loop in php to display all of the records. For each record, I added an input text box with a button to update one of the fields in the record set. When I run the script only the first listing will update and the subsequent listings on the page will not update. Should I go about this set up differently? Code: [Select] <html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <head> <?php session_start(); ?> <script language="JavaScript"> TargetDate = "11/18/2011 6:00 PM"; BackColor = "palegreen"; ForeColor = "navy"; CountActive = true; CountStepper = -1; LeadingZero = true; DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; FinishMessage = "It is finally here!"; </script> <script language="JavaScript" src="http://scripts.hashemian.com/js/countdown.js"></script> <!-- function timedRefresh(timeoutPeriod) { setTimeout("location.reload(true);",timeoutPeriod); } // --> <script type="text/JavaScript"> function showCurrentPrice(str,str1) { if (str=="") { document.getElementById("priceElement").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("priceElement").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","getPrice.php?q="+str+"&s="+str1,true); xmlhttp.send(); } </script> <?php $con=mysql_connect("xxxx", "xxxx", "xxxx") or die ("cannot connect"); mysql_select_db("tab_test") or die ("cannot select database"); echo 'Welcome ' .$_SESSION['username']. '!'; echo '<br /><br /><br />'; echo '<a href="tab_logout.php">Sign Out</a>'; $result=mysql_query("SELECT treeID, treeName, treePicture, treeGiver, treeDesc, CurrentPrice FROM Trees ORDER BY treeName"); $treeID=$_POST['treeID']; $newPrice=$_POST['newBid']; $result2=mysql_query("UPDATE Trees SET CurrentPrice ='$newPrice' WHERE treeID = '$treeID'"); ?> </head> <body> <table> <tr> <td>Active Trees</td> </tr> </table> <?php while($row=mysql_fetch_array($result)) { $treeID=$row['treeID']; echo "<form>"; echo "<table>"; echo "<tr><td><img src=" .$row['treePicture']. "></td></tr>"; echo "<tr><td><input type=\"text\" name=\"treeID\" id=\"treeID\" value=\"" .$treeID. "\" /></td></tr>"; echo "<tr><td>Current Price: $" .$row['CurrentPrice']. "<div id=\"priceElement\"></div></td></tr>"; echo "<tr><td>New Bid: <input type=\"text\" id=\"newBid\" name=\"newBid\" \><button type=\"button\" name=\"bidNow\" value=\"Bid\" onclick=\"showCurrentPrice(document.getElementById('treeID').value,document.getElementById('newBid').value)\"></td></tr>"; echo "<tr><td>" .$row['treeName']. "</td></tr>"; echo "<tr><td>" .$row['treeGiver']. "</td></tr>"; echo "<tr><td>" .$row['treeDesc']. "</td></tr>"; echo "</table>"; echo "</form>"; } ?> </body> <?php mysql_close($con); ?> </html> Hi guys I have created a profile page where users can update their profile. what I need to do is to echo back the users details in the inout text I have name and telephone number any ideas how to do it? here is my code <?php session_start(); include ("global.php"); //username session $_SESSION['username']=='$username'; $username=$_SESSION['username']; //welcome messaage echo "Welcome, " .$_SESSION['username']."!<p>"; if ($_POST['register']) { //get form data $name = addslashes(strip_tags($_POST['name'])); $telephonenumber = addslashes(strip_tags($_POST['telephonenumber'])); $query = "UPDATE users SET name = ' $name' WHERE username='$username'"; $result = mysql_query($query); $query = "UPDATE users SET telephonenumber = ' $telephonenumber' WHERE username='$username'"; $result = mysql_query($query); } ?> <form action='updateprofile.php' method='POST'> Company Name:<br /> <input type='text' name='name'><p /> <input type='text' name='telephonenumber'><p /> <input type='submit' name='register' value='Register'> </form> _______ the reason i want to do this is because when user is updating the name field the empty input text for telephone number ovverides the telephone number field in the database. I would aprreciate your help guys, |