
imperialized
Members-
Posts
100 -
Joined
-
Last visited
Everything posted by imperialized
-
Ok, here is my problem.. this script cycles through the array $email[] and replaces certain wildcards with different variables. However, It puts the same variables for every email that is sent. How would I change my loop so that it will send a customized email to each person? foreach ($emails as $email) { // do something $to = "$email"; $subject = "$subject"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= 'From: [email protected]' . "\r\n" . 'reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); #connec to DB and get their info to replace the codes $query = mysql_query("SELECT * FROM poker_users WHERE email='$email' LIMIT 1"); while($x = mysql_fetch_array($query)){ $fname = $x['fname']; $lname = $x['lname']; $poker_name = $x['poker_name']; $msg = str_replace("%fname%", $fname, $msg); $msg = str_replace("%lname%", $lname, $msg); $msg = str_replace("%pname%", $poker_name, $msg); print "to: $email msg: $msg"; # $go = mail($to, $subject, $msg, $headers); } }
-
Wow... way for me to overlook that. haha, thanks for the quick reply
-
#connec to DB and get their info to replace the codes $query = mysql_query("SELECT * FROM poker_users WHERE email='$email'"); while($x = mysql_fetch_array($query)){ $fname = $x['fname']; $lname = $x['lname']; $poker_name = $x['poker_name']; str_replace("%fname%", $fname, $msg); str_replace("%lname%", $lname, $msg); str_replace("%pname%", $poker_name, $msg); print "$msg"; exit; } That's my code, the variables from the database are coming out just fine. The variables %fname% etc are coming through a form and are being sent correctly. It outputs: %fname% %lname% %pname% and does not replace them with the new vars.. any help is appreciated. Thanks
-
Check my above post, that should do it. I gotta go to class, so I cant help any further at the moment.. Good luck with your coding
-
Your problem lies here: // Insert the new users info into the database $insert = "INSERT INTO Users (username, password) VALUES ('".$_POST['username']."', '".$_POST['pass']."','".$_POST['firstname']."','".$_POST['lastname']."','".$_POST['email']."')"; $add_member = mysql_query($insert); you need to be sure you have all the fields for example: // Insert the new users info into the database $insert = "INSERT INTO Users (username, password, firstname, lastname, email) <--- here VALUES ('".$_POST['username']."', '".$_POST['pass']."','".$_POST['firstname']."','".$_POST['lastname']."','".$_POST['email']."')"; $add_member = mysql_query($insert); you could also add this: $add_member = mysql_query($insert) or DIE("Error Occured :" . mysql_error()); this will tell you if the query has failed. Edit: the $end error is due to a miss } you need to add one at the bottom if (isset($_POST['submit'])) { this block is not closed, add it here: $add_member = mysql_query($insert); } <-- ?>
-
[SOLVED] Order a MySQL query by total
imperialized replied to imperialized's topic in PHP Coding Help
That's exactly what it was, got it a hurry setting up the table. thanks -
Ok, here is my problem.. I'm tryin to run a top 10 for a website I am working on, however, the display is incorrect. $top_10 = @mysql_query("SELECT * FROM poker_users ORDER BY chips DESC LIMIT 10"); while($x = mysql_fetch_array($top_10)) { $xname = $x['poker_name']; $chips_total = $x['chips']; print "<tr> <td width=75><b><a href=\"#\" onClick=\"ajax('content','profile.php?account=$xname')\">$xname</a></b> </td> <td>$chips_total </td>"; print "</tr>"; } Outputs this: Top 10 Players: David 997015289 CritEater 875 Chris 1767 XxCassi16xX 11700 Admin 102979237 David1 1000 TChip 1000 NickieJ 1000 Criswell 1000 david23 1000 Its obvious what the problem is.. I just don't know how to solve it..
-
[SOLVED] Controlling content outside an Iframe
imperialized replied to imperialized's topic in Javascript Help
Got frustrated, got rid of frame. Problem solved. -
[SOLVED] Controlling content outside an Iframe
imperialized replied to imperialized's topic in Javascript Help
Ok since it will not let me edit my former post, I switched and tried using the ajax model given here, MyAjaxRequest.. I know the problem must be locating the <DIV> that is outside the Iframe.. any help is greatly appreciated. Thanks -
Ok, I've been trying to get this to work with no prevail. What I have is a page with an Iframe, and outside the Iframe I have my menu. Its located in <div id=\"menu\"> When I load my index2.php (the page that people go to after login) it calls: <body onload=\"updateMenu()\"> This script calls this: function menu_stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("menu").innerHTML=xmlHttp.responseText } } function updateMenu() { xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } url = "menu_check.php"; xmlHttp.onreadystatechange=menu_stateChanged xmlHttp.open("GET",url,true) xmlHttp.send(null) } I can't get it to work though, any suggestions?
-
This would be done using javascript, not sure on the exact code, however if you use the OnClick event, you could do it like this <script language="javascript"> function disable() { document.form.field.disabled=true; } </script> <input type=radio value="x" OnClick="disable()"> This should be moved to the javascript section //Granted, I dont know if this will work, but it should get you headed in the right direction
-
I know this has nothing to do with PHP and I apologize, but I know that people here will probably know because it is simple HTML. Of Course, if this gets deleted I understand. As I don't usually work with frames I am stuck trying to get the frames to work as I'd like. If you could help i'd appreciate it. Please don't delete this mods!! Basically I want the frame layout to look like this __________________________________ Frame 1 __________________________________ | | | Frame 2 | Frame 3 | | | ___________________________________ Frame 4 ___________________________________
-
I guess this is solved, the problem was using the same form element name for both password and email fields, so javascript wasnt erroring but couldnt get the values. solved.
-
Ok, so I created a form that validates with ajax if an error is encountered, it will return a value. example: The original code is this: <tr> <td width=350> <b>Email Address:</b><br> <font size=2>*Email address MUST be valid in order to play.</font> </td> <td> <span id=\"email_chk\"> <input id=\"email\" name=\"email\" type=\"text\" class=\"reg_form\" maxlength=\"80\" onblur=\"check_email(this.form)\"> </span> </td> </tr> the returned code is this: print "<input id=\"email\" name=\"email\" type=\"text\" class=\"reg_form\" maxlength=\"80\" style=\"$failed\" value=\"$email\" onblur=\"check_email(this.form)\"> $x <br> <font size=1.5 color=red>Email does not match! ---> <input type=hidden name=\"email_error\" value=\"1\"> sets the error value to 1 When I call my javascript: var email_error=document.registration_form.email_error.value; if(email_error == 1){ alert('Check your email!'); return false; } The javascript doesn't catch anything or provide an alert... I dont know javascript for shit so I am lost
-
//Original untouched. In the following order: $_POST $_SESSION $_SERVER ~ gname: throwme ~ gscore: 32 ~ CONTENT_LENGTH: 23 ~ CONTENT_TYPE: application/x-www-form-urlencoded ~ DOCUMENT_ROOT: /home/jaymartin/domains/imperialized.com/public_html ~ HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 ~ HTTP_ACCEPT_CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.7 ~ HTTP_ACCEPT_ENCODING: gzip,deflate ~ HTTP_ACCEPT_LANGUAGE: en-us,en;q=0.5 ~ HTTP_CACHE_CONTROL: max-age=0 ~ HTTP_CONNECTION: keep-alive ~ HTTP_COOKIE: gname=throwme; valid_user=David; phpqa_user_c=David; phpqa_user_p=81e546567d978740ee728053adf65275; PHPSESSID=2bbc7afc848e083a1645927dd864f7c3 ~ HTTP_HOST: www.imperialized.com ~ HTTP_KEEP_ALIVE: 300 ~ HTTP_REFERER: http://www.imperialized.com/arcade/Arcade.php?play=throwme ~ HTTP_USER_AGENT: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 ~ PATH: /etc:/bin:/sbin:/usr/bin:/usr/sbin ~ REMOTE_ADDR: 76.125.203.130 ~ REMOTE_PORT: 2876 ~ SCRIPT_FILENAME: /home/jaymartin/domains/imperialized.com/public_html/arcade/index.php ~ SERVER_ADDR: 204.13.53.2 ~ SERVER_ADMIN: [email protected] ~ SERVER_NAME: www.imperialized.com ~ SERVER_PORT: 80 ~ SERVER_SIGNATURE: Apache/1.3.37 Server at www.imperialized.com Port 80 ~ SERVER_SOFTWARE: Apache/1.3.37 (Unix) PHP/5.2.3 mod_ssl/2.8.28 OpenSSL/0.9.7e-p1 FrontPage/5.0.2.2510 ~ GATEWAY_INTERFACE: CGI/1.1 ~ SERVER_PROTOCOL: HTTP/1.1 ~ REQUEST_METHOD: POST ~ QUERY_STRING: act=Arcade&do=newscore ~ REQUEST_URI: /arcade/index.php?act=Arcade&do=newscore ~ SCRIPT_NAME: /arcade/index.php ~ PATH_TRANSLATED: /home/jaymartin/domains/imperialized.com/public_html/arcade/index.php ~ PHP_SELF: /arcade/index.php ~ REQUEST_TIME: 1232263241 [argv] |~ 0: act=Arcade&do=newscore ~ argc: 1 // This is the tampered info ~ gname: throwme ~ gscore: 9999999 ~ CONTENT_LENGTH: 28 ~ CONTENT_TYPE: application/x-www-form-urlencoded ~ DOCUMENT_ROOT: /home/jaymartin/domains/imperialized.com/public_html ~ HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 ~ HTTP_ACCEPT_CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.7 ~ HTTP_ACCEPT_ENCODING: gzip,deflate ~ HTTP_ACCEPT_LANGUAGE: en-us,en;q=0.5 ~ HTTP_CONNECTION: keep-alive ~ HTTP_COOKIE: gname=throwme; valid_user=David; phpqa_user_c=David; phpqa_user_p=81e546567d978740ee728053adf65275; PHPSESSID=2bbc7afc848e083a1645927dd864f7c3 ~ HTTP_HOST: www.imperialized.com ~ HTTP_KEEP_ALIVE: 300 ~ HTTP_REFERER: http://www.imperialized.com/arcade/Arcade.php?play=throwme ~ HTTP_USER_AGENT: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 ~ PATH: /etc:/bin:/sbin:/usr/bin:/usr/sbin ~ REMOTE_ADDR: 76.125.203.130 ~ REMOTE_PORT: 2905 ~ SCRIPT_FILENAME: /home/jaymartin/domains/imperialized.com/public_html/arcade/index.php ~ SERVER_ADDR: 204.13.53.2 ~ SERVER_ADMIN: [email protected] ~ SERVER_NAME: www.imperialized.com ~ SERVER_PORT: 80 ~ SERVER_SIGNATURE: Apache/1.3.37 Server at www.imperialized.com Port 80 ~ SERVER_SOFTWARE: Apache/1.3.37 (Unix) PHP/5.2.3 mod_ssl/2.8.28 OpenSSL/0.9.7e-p1 FrontPage/5.0.2.2510 ~ GATEWAY_INTERFACE: CGI/1.1 ~ SERVER_PROTOCOL: HTTP/1.1 ~ REQUEST_METHOD: POST ~ QUERY_STRING: act=Arcade&do=newscore ~ REQUEST_URI: /arcade/index.php?act=Arcade&do=newscore ~ SCRIPT_NAME: /arcade/index.php ~ PATH_TRANSLATED: /home/jaymartin/domains/imperialized.com/public_html/arcade/index.php ~ PHP_SELF: /arcade/index.php ~ REQUEST_TIME: 1232263314 [argv] |~ 0: act=Arcade&do=newscore ~ argc: 1
-
the problem is, I dont think I can catch the score before the tamper program would.. What im saying is, capture the score, create the hash Pass the score and the hash to the verification.. the score, if changed, would not pass the verification of comparing it to the hash. I wouldnt need to recover the hash, just compare it to the score that was passed... I dont think this would be possible though
-
Do you think there would be a way to capture the score before the user had a chance to change it? If thats the case, I could use a hash on the score to check it. For example: a = real score b = fake score md5(a) = x if md5(a) = x -- score is real if they passed b through md5(b) = x -- it would not pass b/c the hash would be different.... ...pondering
-
No, I don't write any of the games. The games are from IPB arcade (games written to be used with that forum) I have access to all other elements, aside from what happens within the flash game itself.
-
Yea, it is php Quick Arcade (using flash games and mysql)
-
I don't know that sending and saving a random number would do the trick. The problem would lie here: Say a user (1) is playing a game (already loaded the page) while another user has just submitted a score. The user (1) then tries to send his score, his number wouldnt match the number the server expected because he parsed the page prior to the new number being set.
-
Ok, well I have been using a php arcade script to allow my users to play games on my website. However, I was recently informed of a program called "Tamper Data" a plug in for firefox, which allowed users to change the scores that were being passed to the server.. is there any way to prevent such info from being changed? Or rather, how do you check to ensure that the information was not altered
-
Ok, well.. here I go I have a website that I wish to offer a subscription service for, to be paid with through paypal. (credit cards/etc in the future) How would I go about writing a page that will automatically detect payments? Once this is done, set the Account to 'subscribed' (i know how to do the query update, this isnt a problem.) Something like.. when you purchase a service package for webhosting, it sets the account up and gets you rolling. I just need to know how to go about writing a Subscription thing so I can check when subscriptions were made. I hope this somewhat makes sense. I just don't know where to start the process. I know how to check if a subscription is running low by checking the date, etc, but where to begin? Any help is appreciated.
-
Please check for vulnerabilities/mistakes!
imperialized replied to imperialized's topic in Beta Test Your Stuff!
Full Path Disclosure: http://www.imperialized.net/arcade/Arcade.php?action=profile&user[] Full Path Disclosure: http://www.imperialized.net/arcade/Arcade.php?cat=&limit[] Full Path Disclosure: http://www.imperialized.net/arcade/Arcade.php?play[] -
Please check for vulnerabilities/mistakes!
imperialized replied to imperialized's topic in Beta Test Your Stuff!
Should all be fixed. Thanks for the help. -
Please check for vulnerabilities/mistakes!
imperialized replied to imperialized's topic in Beta Test Your Stuff!
Ok Ok! Time to test some new parts of the site! I hope you guys can help.. Ok, well.. I've been playing around with AJAX a little bit and incorporating it into my website. I've added users the ability to post comments on images that have been uploaded, and also have created a Chat room.. The Chat does not seem to function in IE, so for those of you using IE, the Chat will not display for you, however, the image comments page will. If someone has some time, please take a look around to ensure security, functionality. Thanks, David ps. login is still guest/guest