PHP - I Have Had This Problem Before But It Fixed Itself...
I'm having trouble with this emailing script. As you can see it clearly sets the contect typw to text/html but when you read the email it's not in HTML like intended
$to=$email; $subject='Activate your account.'; $message=" <html> <head> <title>Activate your account that doesn't show in HTML damn it -.-</title> </head> <body> <p>Nothing here.</p> </body> </html> "; // To send HTML mail, the Content-type header must be PROPERLY set $headers = 'MIME-Version: 1.0' . '\r\n'; $headers .= 'Content-type: text/html; charset=iso-8859-1' . '\r\n'; // Additional headers $headers .= 'To: $fname <$email>' . '\r\n'; $headers .= 'From: **************' . '\r\n'; $headers .= 'Reply-To: ******************' . '\r\n'; $headers .= 'X-Mailer: PHP/' . phpversion(); // Mail it $mail=mail($to, $subject, $message, $headers); Can someone help me solve why it's sending as plain text and not HTML this is getting annoying Thanks in advance, Similar TutorialsGuys thanks for helping me solve the problem i had but now i have another problem and i am lost. i have included the code below for you to have overview.
This is the code:
<table style="width:100%; margin-left:auto; margin-right:auto"> hi there is this game i play and i am trying to accomplish a code which adds items coming from the games xml.
the game is called zwinky and i'm having a small problem which can maybe be easily fixed.
Here are the codes:
http://paste.ee/p/JHMow
http://paste.ee/p/pIEUt
they are written differently. Okay So the problem is a little message when used on my webhost comes up on browser saying :
"HTTP/1.1 100 Continue HTTP/1.1 200 OK Date: Sat, 24 May 2014 22:52:31 GMT Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8c DAV/2 mod_jk/1.2.28 Cache-Control: max-age=0, must-revalidate Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: anx="os=-&g=-&oc=-&sn=dfprdzwinky4&od=none&op=-&fv=1400971951270&ob=-&om=-&lv=1400971951270&ok=-&nv=1"; Version=1; Domain=.zwinky.com; Max-Age=7776000; Expires=Fri, 22-Aug-2014 22:52:31 GMT; Path=/ Content-Language: en-US Content-Length: 92 Connection: close Content-Type: application/xml;charset=UTF-8 User not signed in"
as you can see it says "user not signed in" yet i am signed in into the game.. So i believe somewhere in the code the cookies are wrong or the code doesn't have the necessary elements to show that you are being logged in. to get the cookies/ login info you need to create a game account which takes 10-20 seconds: http://registration..../register.jhtml
and then using fiddler/charles or any other method displaying the accounts cookies it should show them up.
I don't know what is needed to add to the code to make it work
here our other topics on this issue never solved which might help:
http://forum.ragezon...44/help-920369/
http://www.webdevelo...129-php-execute
if anyone could help please! it's not hard making the game accounts and viewing the cookies, please and thank you!!!!
hi there is this game i play and i am trying to accomplish a code which adds items coming from the games xml.
the game is called zwinky and i'm having a small problem which can maybe be easily fixed.
Here are the codes:
http://paste.ee/p/JHMow
http://paste.ee/p/pIEUt
they are written differently. Okay So the problem is a little message when used on my webhost comes up on browser saying :
"HTTP/1.1 100 Continue HTTP/1.1 200 OK Date: Sat, 24 May 2014 22:52:31 GMT Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8c DAV/2 mod_jk/1.2.28 Cache-Control: max-age=0, must-revalidate Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: anx="os=-&g=-&oc=-&sn=dfprdzwinky4&od=none&op=-&fv=1400971951270&ob=-&om=-&lv=1400971951270&ok=-&nv=1"; Version=1; Domain=.zwinky.com; Max-Age=7776000; Expires=Fri, 22-Aug-2014 22:52:31 GMT; Path=/ Content-Language: en-US Content-Length: 92 Connection: close Content-Type: application/xml;charset=UTF-8 User not signed in"
as you can see it says "user not signed in" yet i am signed in into the game.. So i believe somewhere in the code the cookies are wrong or the code doesn't have the necessary elements to show that you are being logged in. to get the cookies/ login info you need to create a game account which takes 10-20 seconds: http://registration..../register.jhtml
and then using fiddler/charles or any other method displaying the accounts cookies it should show them up.
I don't know what is needed to add to the code to make it work
here our other topics on this issue never solved which might help:
http://forum.ragezon...44/help-920369/
http://www.webdevelo...129-php-execute
if anyone could help please! it's not hard making the game accounts and viewing the cookies, please and thank you!!!!
Hi ,
I try to change a PHP code for a booking program without succes. Now the time set is from 00.00 - 24.00hours but it must be fixed on 15.00H ( dropoff) and 11.00H (pick-up). Can someone help me please ?
Big thanks in advance !
$pickhdeftime = !empty($places[$indvrcplace]['defaulttime']) ? ((int)$places[$indvrcplace]['defaulttime'] / 3600) : ''; Hey, I'm getting an undefined index in my final test and would like to know that this is fixed and I don't have to worry about any troubles.. here is what's going on Notice: Undefined index: register in C:\wamp\www\unitedsticks\insert.php on line 6 Registered! Return Notice: Undefined index: class in C:\wamp\www\unitedsticks\insert.php on line 58 1 record added Now...It Registers and does everything it's meant to, I just want the undefined index gone...here's my coding: THIS IS insert.php Code: [Select] <?php session_start(); mysql_connect("localhost", "root", ""); // Server connection mysql_select_db("myfirstdatabase"); // Database selection $page = $_POST['register']; // Setting the page value $user = $_POST['username']; // Setting the user value $pass = $_POST['password']; // Setting the pass value if($page == 1) { //This means that the page is the register form so the register form code goes here $query = mysql_query("select * FROM userdata WHERE username = '$user'"); // Queries the Database to check if the user already exists if(mysql_num_rows($query) !== 0) // Checks if there is any rows with that user { echo "THIS USER IS ALREADY TAKEN!"; // Stops there } else { mysql_query("INSERT INTO userdata (username, password) VALUES('$user', '$pass')"); // Inserts into the database. echo "REGISTERED! <BR> <a href='index.php'>Go to the login page</a>"; //Link and text to go to the login } } ?> <?php if($page == 0) { //This means that the page is the login form so the register form code goes here $query = mysql_query("SELECT username FROM userdata WHERE username = '$user'"); // Queries the Database to check if the user doesn't exist if(mysql_num_rows($query) == 0) // Checks if there is any rows with that user { echo "User doesn't exist"; // Stops there } $query = mysql_query("SELECT username FROM userdata WHERE username = '$user' AND password = '$pass'"); if(mysql_num_rows($query) !== 0) // Checks if there is any rows with that user and pass { echo "Registered!<BR> <a href='index.php'>Return</a>"; //Link and text to go to the login $_SESSION['LOGGEDIN'] = 1; } } ?> <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("database", $con); $sql="INSERT INTO register (username, password, class) VALUES ('$_POST[username]','$_POST[password]','$_POST[class]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($con) ?> And my other coding: Code: [Select] <html> <body> <center><p><p><!-- Main Table(You can define padding accordingly) --> <table width="50%" border="0" cellspacing="0" cellpadding="5"> <td width="50%"> <!-- Table on left side --> <table width="90%" height="100%" border="1" cel1pacing="0" cellpadding="0" BORDERCOLOR="#007FFF"> <body style="background-color:;"> <td><h3><center><h3 style="background: blue; color: white;">Create Account Here<br></font></center></h2><p> <h4><p>Login Information</h4></p> <form action="insert.php" method="post"> Username: <input type="text" name="username" /><br> Password: <input type="password" name="password" /> <h3>Choose your Class</h2> <table width="100%" border="1"> <tr> <p> <label> <input type="radio" name="class" value="Clubber" id="SC" /> Clubber</label> <br /> <label> <input type="radio" name="class" value="Pastamancer" id="PM" /> Pastamancer</label> <br /> <label> <input type="radio" name="class" value="" id="" /><br> <center><input type="submit" /></center> </label> <br /> </p></td> </tr> </table> </form> </body> </html> Thanks for any help... Brent. This isn't for anything practical, I'm just fiddling. Anyways, I'm wondering if there's anyway to make this more efficient since at higher lengths it could become really heavy. $l is length of the number. function fixed_random($l) { $number = ""; do { $r = mt_rand(0, $l); $number .= $r; } while (strlen($number) < $l); return $number; } hi,
I am using fixed-header code for my table on vertical scroll, its working fine for all column name except last two (balance and pay status) because they are going out side page (horizontally). and when i scroll from bottom to see the last two columns values , the fixed header only show the columns till advance, fixed header not showing last two remaining columns that go out side page horizontally.
Check the screen shots for better understanding.
image-1 you can see all column till pay status.
[ATTACH=CONFIG]64973[/ATTACH]
image -2 you can see vertical scroll working fine till advance column.
[ATTACH=CONFIG]64974[/ATTACH]
Image -3 but in this you can see after full horizontal scroll towards right side, it only showing column till advance, instead of balance and pay status.
[ATTACH=CONFIG]64975[/ATTACH]
Here is the full code
Untitled Document $(document).ready(function() { function moveScroll(){ var scroll = $(window).scrollTop(); var anchor_top = $("#maintable").offset().top; var anchor_bottom = $("#bottom_anchor").offset().top; if (scroll>anchor_top && scrollPlease check this and if found give me the solution for this. thanks in Advance Attached Files image-2.jpg 218.01KB 0 downloads HI All I have created a large html dynamic table using jquery . Now my query is here , How to make a fixed html table header while scrolling . can any one please hepl me how to solve ?? This topic has been moved to Apache HTTP Server. http://www.phpfreaks.com/forums/index.php?topic=343321.0 i have the following sql running on local but i get an error. the sql: $sql = "SELECT * FROM '".TBL_PARENTS."'" or die(mysql_error()); the config file: define('DB_PREFIX', 'forum_'); define('TBL_PARENTS', DB_PREFIX.'parents'); the error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''forum_parents'' at line 1 the echoed sql: SELECT * FROM 'forum_parents' as you can see when it is echoed it looks fine. Any ideas? The server im using is wamp server. Hi guys, I'm working on a side-project whilst my work at Uni is at a low but I'm extremely rusty on PHP; I've not touched it since around '07. Before I get on to my project, which will lift information from external websites, I'm just trying to acquaint myself with cURL again. Before I get flamed, yes this code is largely lifted from a website, but I pretty much understand it. My aim is to be able to get the title of a website, namely Facebook. Whilst this code is fine on seemingly any other website, it doesn't seem to be able to work for Facebook. I've checked the source code, and I really can't see the problem. Can anyone shed some light for me? Code: [Select] <?php $url = 'http://www.facebook.com/'; $webinfo = get_data($url); $title = get_match('/<title>(.*)<\/title>',$webinfo); $content= '<h2>Title of webpage: </h2><p>'.$name.'</p>'; echo $content; function get_match($regex,$content) { preg_match($regex,$content,$matches); return $matches[1]; } //gets the data from a URL function get_data($url) { $ch = curl_init(); $timeout = 5; curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); $data = curl_exec($ch); curl_close($ch); return $data; } ?> Thanks!!! im trying to get this code to determine whether or not the form entered had anything in it, and if it doesn't show an error message and redirect the user back to the form. and if it does have content sumbit it. the problems i've had so far is either it will display the message, and submit the empty form or just not work at all. ill attatch the entire code. Code: [Select] <?php $msg=fopen('data1.txt','r'); $read=fgets($msg); print "\""; echo $read; print "\""; fclose($msg); ?> <?php $submit = $_REQUEST['submit']; $data = $_POST['data']; $file = "data1.txt"; $fp = fopen($file, "w") or die("ohno something went wrong"); if(empty($data)) { echo "no text entered, redirecting... or click <a href=\"index.php\">here</a><meta http-equiv=\"refresh\" content=\"3;url=index.php\" />"; } else($submit == 1) { fwrite($fp, $data); fclose($fp); echo "post submitted, redirecting... or click <a href=\"index.php\">here</a><meta http-equiv=\"refresh\" content=\"3;url=index.php\" />"; } ?> <form name="form" method="post" action="index.php?submit=1"> <textarea name="data" rows="4"></textarea> <input type="submit" value="write" /> </form> Hi all. When I typed symbol ' in my textarea , after I submit it and view for what I typed , it will automatically add a slash in front of the ' . Such as the message is "I'm fine" , then it will turn out as "I\'m fine". Can I know what is the problem ? and how can I solve it? Thanks for every reply . I Have An error on line 42 not sure what it is can any one tell? $foundnum = mysql_num_rows($run); Hows it going guys. I am currently having a problem. I had a program that worked. I migrated the website and now the program is broken. Any time i try to run it, i get this error: Quote Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/thegoo20/public_html/class/wordgame/wordgame.php on line 31 Here is the code at that point: Code: [Select] function changeword(){ $result = mysql_query("Select words from CurrentWords"); $totalwords = array(); while ($row = mysql_fetch_array($result)){ $totalwords[] = $row["words"]; } $_SESSION['word'] = $totalwords[rand(0, count($totalwords)-1)]; $_SESSION['scrambled'] = str_shuffle($_SESSION['word']); } where line 31 is the while statement. Any help would be appreciated. Thanks I am trying to use the following code snippet to return values from a database with a "," after each value apart form the last one. At the moment for testing I have 2 rows with values 1 and 3 $totalRows_Recordset3 equals 2 (I echoed this to check) $i=1; while($row_Recordset3 = mysql_fetch_assoc($Recordset3)) { if($i < $totalRows_Recordset3) { $str = $str.$row_Recordset3['reading'].","; $i=$i+1; } else { $str = $str.$row_Recordset3['reading']; $i=$i+1; } } I get the number 3 which is the last value in the database, but I can't see why I don't get "1,3" I am sure it is something simple but it just escapes me. Thanks in advance for any help Gordon Hi I make 3 querys first Order by DESC, second RAND() and third ASC. Now I want that in the second query can't be the same ids (produgg_users.id) that already taken in the first. And in the third not the ids from first and second. Like I have it now the same users can show up in the RAND() and the ASC like in DESC. Here my Script so far: $rs = mysql_query("select produgg_users.id, twitterUser, credits from produgg_users where twitterUser != '' and produgg_users.id IN (select concat_ws(',', id) from produgg_users where credits > 0 and id != ".$usersClass->userID().") and produgg_users.id NOT IN (select concat_ws(',', followedID) from produgg_activity where followerID = '".$usersClass->userID()."') and produgg_users.id NOT IN (select concat_ws(',', userid) from produgg_featured) ORDER BY credits DESC LIMIT 10") or die(mysql_error()); $nr = @mysql_num_rows($rs); if($nr != 0) { print "<p>Simply click <strong>get 1 point</strong> and you will automatically FOLLOW the USER and earn the credit!</p>"; print "<p><font color=\"#0066FF\">Top Members</font></p>"; while($row=@mysql_fetch_object($rs)) { $divLeft = '<div id="thediv_'.$row->id.'"><div style="float:left;width:400px;">'; $divRight = '<div style="float:left;width:150px;">'; $clearDiv = '<div style="clear:both;"></div>'; print "$divLeft<img src=\"http://api.twitter.com/1/users/profile_image/".strip_tags($row->twitterUser)."?size=mini\" alt=\"\" /> ".strip_tags($row->twitterUser)." <font color=\"#999999\" size=\"1\">$row->credits Points</font></div>$divRight <a href='javascript:void(0);' id='vote_$row->id' class='getPoint'>Get 1 Point</a></div>$clearDiv<hr /></div>"; $z = 1; } } //Lucky Riders $rs = mysql_query("select produgg_users.id, twitterUser, credits from produgg_users where twitterUser != '' and produgg_users.id IN (select concat_ws(',', id) from produgg_users where credits > 0 and id != ".$usersClass->userID().") and produgg_users.id NOT IN (select concat_ws(',', followedID) from produgg_activity where followerID = '".$usersClass->userID()."') and produgg_users.id NOT IN (select concat_ws(',', userid) from produgg_featured) ORDER BY RAND() LIMIT 5") or die(mysql_error()); $nr = @mysql_num_rows($rs); if($nr != 0) { print "<p><font color=\"#0066FF\">Lucky Riders</font></p>"; while($row=@mysql_fetch_object($rs)) { $divLeft = '<div id="thediv_'.$row->id.'"><div style="float:left;width:400px;">'; $divRight = '<div style="float:left;width:150px;">'; $clearDiv = '<div style="clear:both;"></div>'; print "$divLeft<img src=\"http://api.twitter.com/1/users/profile_image/".strip_tags($row->twitterUser)."?size=mini\" alt=\"\" /> ".strip_tags($row->twitterUser)." <font color=\"#999999\" size=\"1\">$row->credits Points</font></div>$divRight <a href='javascript:void(0);' id='vote_$row->id' class='getPoint'>Get 1 Point</a></div>$clearDiv<hr /></div>"; $z = 1; } } //Lucky Riders $rs = mysql_query("select produgg_users.id, twitterUser, credits from produgg_users where twitterUser != '' and produgg_users.id IN (select concat_ws(',', id) from produgg_users where credits > 0 and id != ".$usersClass->userID().") and produgg_users.id NOT IN (select concat_ws(',', followedID) from produgg_activity where followerID = '".$usersClass->userID()."') and produgg_users.id NOT IN (select concat_ws(',', userid) from produgg_featured) ORDER BY credits ASC LIMIT 5") or die(mysql_error()); $nr = @mysql_num_rows($rs); if($nr != 0) { print "<p><font color=\"#0066FF\">Last Rides</font></p>"; while($row=@mysql_fetch_object($rs)) { $divLeft = '<div id="thediv_'.$row->id.'"><div style="float:left;width:400px;">'; $divRight = '<div style="float:left;width:150px;">'; $clearDiv = '<div style="clear:both;"></div>'; print "$divLeft<img src=\"http://api.twitter.com/1/users/profile_image/".strip_tags($row->twitterUser)."?size=mini\" alt=\"\" /> ".strip_tags($row->twitterUser)." <font color=\"#999999\" size=\"1\">$row->credits Points</font></div>$divRight <a href='javascript:void(0);' id='vote_$row->id' class='getPoint'>Get 1 Point</a></div>$clearDiv<hr /></div>"; $z = 1; } } Okay, so i'm using the basic php mysql insert into function but I have a strange (or maybe not so strange, I just don't get it..) problem.. I have two columns (do you call them columns? I don't really know for sure, whatever things that are in a table whatsoever). Name and Trailer. EDIT: they are TEXT's if that matters Name is really nothing important, just the name. But I want to embed trailers.. If I embed the Megavideo code below: Code: [Select] <object width="400" height="300"><param name="movie" value="http://www.megavideo.com/v/8UZFURZQ2b55ada04d73ae65c726a5383b9ee9d9"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.megavideo.com/v/8UZFURZQ2b55ada04d73ae65c726a5383b9ee9d9" type="application/x-shockwave-flash" allowfullscreen="true" width="400" height="300"></embed></object> Everything works fine, no problems and no bullshit. But.. if I for an example try to embed this one (NovaMov): Code: [Select] <iframe style='overflow: hidden; border: 0; width: 400px; height: 300px' src='http://embed.novamov.com/embed.php?width=400&height=300&v=xngq7u8yejwbt' scrolling='no'></iframe> It doesn't work. It just doesn't insert. Is inserting an "iframe" a problem or something? I just don't get why the hell it would do this? Does anyone know anything about this? If so i'd be eager and very thankful to hear why and how to fix it. thanks in advance I do not receive email for my published php file which is: <?php ///// easend.php ///// $youremail = "acdelco40108@yahoo.com"; /*put the email address here, between quotes, the email address you want the message sent to*/ $to = $youremail; $email = $_POST['EMail']; $name2 = $_POST['Name']; $street2 = $_POST['Street']; $city2 = $_POST['City']; $state2 = $_POST['State']; $zip2 = $_POST['Zip']; $Phone = $_POST['Home_Phone']; $Cell = $_POST['Cell_Phone']; $education = $_POST['email1']; $comments = $_POST['email2'] ; $headers = "From:" . $email; $fields = array(); $fields{"Name"} = "Name"; $fields{"Street"} = "Street"; $fields{"City"} = "City"; $fields{"State"} = "State"; $fields{"Zip"} = "Zip"; $fields{"Home_Phone"} = "Home Phone"; $fields{"Cell_Phone"} = "Cell Phone"; $fields{"EMail"} = "Email"; $fields{"email1"} = "Education"; $fields{"email2"} = "Comments"; $subject = "We have received the following information from your employment application"; $body = "We have received the following information from your employment application:\n\n"; foreach($fields as $a => $b) { $body .= sprintf("%20s: %s\n",$b,$_POST[$a]); } mail ($to, $subject, $body, $headers); //send mail to owner #end create email vars $headers = "From:" . $to; mail ($email, $subject, $body, $headers); //send mail to user #end create email vars echo "<head><META HTTP-EQUIV=\"Refresh\" CONTENT=\"2; URL=ThankYou.html\"></head>"; ?> |