Jump to content

Imokon

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://menstruosity.com

Profile Information

  • Gender
    Female
  • Location
    Houston, TX

Imokon's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey there, I have a complex "detailed sizing form" I am working on for a client, that requires a lot of customization with a few kinks I am having trouble with. I am trying to teach myself php but I think this is beyond me for the time constraints I am in. I hope I can get some advice on what I need to do. The form comes in two versions, one for men, one for women, with the VALUES mailed to my client and a "results page" that is viewable and printable by the visitor. So far I have the men's version somewhat up and going at http://projects.imokon.com/2in10/male_form/form.men.php . Problems I am currently having: #1 I need the resulting values that are sent in the email to be displayed in the "results page". I used the Web Form Factory to generate the php and I am kind of lost on exactly what part of the code I need to paste. I am experimenting right now with my limited knowledge but if you can advise that would be awesome. <h1>Thank you for your submission!</h1> <p>The measurements you entered were:</p> <ul> <li></li> <li></li> <li></li> <li></li> <li>Hip Size:<?php echo (isset($men->hip)? $men->hip: '')?></li> </ul> #2 This is the most important issue - I need to have a list of garments in the results page that is static with the exception of the recommended size. Now this is easy as the only value really factoring into the equation is the chest/coat size, the rest is just FYI sent to my client. <p>Based upon the above we recommend...</p> <p>abdomen men shirt (if chest = 28in - 31in then) in size 2XS</p> <p>Garment2</p> <p>Garment3</p> Essentially I have perhaps 9-11 different ranges that the chest size could be and hence yield a size tag for that garment. Each garment has different ranges that yield to different sizes. I was thinking I might have to write a function with restrictions but not exactly sure on how to specify multiple ranges for each garment. For the Women's version of the form it gets worse. The visitor will be asked to supply values for 1. whether they have hard tissue or soft tissue 2. how their fat is distributed on their body spanning roughly 22 diagrams. 3. if they are older than 60 or younger than 60 Each one of those diagrams will have again a list of garments that specify what size they should order based on EITHER thorax, hips OR waist On some figure types depending if they were over or under 60 yrs old they might be shown a different list of garments On some figure types depending on whether they have hard tissue or soft tissue they will have different ranges that yield to their size of waist, thorax, or hips. Here is an example of what one of the 22 choices might yield: I hope this isn't horribly confusing. I wish I would have known how complex this was but it came through a loophole in the contract. I can't afford to pay a developer full time for this but I will gladly donate something to this site what I can when I am paid the remainder for this project if I can get this thing resolved. If you guys need any more info please don't hesitate to ask away or chew me up. I will be uploading the female version of the form shortly and adding a link here.
  2. I have gained a lot of experience since my previous post; http://www.phpfreaks.com/forums/index.php?topic=221124.0 however I am posting this new one because I have decided to use a brand new webring code package. In this instance, the form I am trying to add the reCAPTCHA to is self processing, so it's harder to integrate the private and public keys together - it simply does not validate. I am trying hard to not get into using the ruby or a non script version (but will if there is absolutely no other choice). So my question is, how do you make the reCAPTCHA validate in a self processing form? Also please note, the webring has it's own basic CAPTCHA that I don't want, I want to use my own reCAPTCHA. The code I don't care for found below; // get some stuff for the CAPTCHA $rand = rand( 10000, 99999 ); $cap_cols = serialize( array( $_HIVEID['captcha_bkg'], $_HIVEID['captcha_txt'] ) ); $cap_bdr = $_HIVEID['captcha_txt'][0] .', '. $_HIVEID['captcha_txt'][1] .', '. $_HIVEID['captcha_txt'][2]; The code I do want to insert is found here; http://recaptcha.net/plugins/php/ The self processing form I am using; <? include( "config.inc.php" ); // check if we're accepting new members // if not, kill the page canJoin(); $_PAGE_NAME = "Join"; include( $_HIVEID['header'] ); // data-check the form if( isset( $_POST['action'] ) && $_POST['action'] == 'join' ) $error = checkUserData(); // get some stuff for the CAPTCHA $rand = rand( 10000, 99999 ); $cap_cols = serialize( array( $_HIVEID['captcha_bkg'], $_HIVEID['captcha_txt'] ) ); $cap_bdr = $_HIVEID['captcha_txt'][0] .', '. $_HIVEID['captcha_txt'][1] .', '. $_HIVEID['captcha_txt'][2]; if( empty( $_POST['action'] ) || !empty( $error ) ){ ?> <h2>Join</h2> <p> Fill out the form below to join this fanlisting. Please make sure you've read the <a href="rules.php" title="Rules">rules</a> and if you have a website, that you put a <a href="codes.php" title="Codes">link</a> back up to <tt><strong><?=$_HIVEID['hiveurl']?></strong></tt> before joining! </p> <p> If you do not provide a password, one will be automatically generated for you. </p> <p> If you wish to update your member information, please <a href="edit.php" title="Edit User Information">click here</a>. </p> <? if( !empty( $error ) ) { ?> <p class="error"> <strong>Error:</strong> <?=$error?> </p> <? } ?> <form method="post" action="join.php" enctype="multipart/form-data"> <fieldset> <legend>Personal Information</legend> <input type="hidden" name="action" value="join"> <?printJSAntiSpam( "j[doIt]" ); printCAPTCHAKey( $rand, "j[verseed]" );?> <label> <input type="text" name="j[memberName]" value="<?=@$_POST['j']['memberName']?>"> Name </label> <label> <input type="password" name="j[memberPass]"> Password </label> <label> <input type="password" name="j[memberPass2]"> Password (Again) </label> <label> <input type="text" name="j[memberEmail]" value="<?=@$_POST['j']['memberEmail']?>"> Email Address </label> <? if( $_HIVEID['hivetype'] == 'FANLISTING' ){ ?> <label class="form-inline"> <input type="radio" name="j[memberEmailVis]" value="yes" checked> display email address </label> <label class="form-inline"> <input type="radio" name="j[memberEmailVis]" value="no"> hide email address </label> <? } if( $_HIVEID['captcha'] ){ print " <label for=\"bcap\">\n". " <input type=\"text\" name=\"j[cap]\" maxlength=\"5\">\n". " <img src=\"../vs.hive/captcha.inc.php?x=$rand&c=$cap_cols\" style=\"border: 1px solid rgb( $cap_bdr );\" alt=\"CAPTCHA Image\">\n". " </label>\n"; } ?> </fieldset> <fieldset> <legend>Membership Details</legend> <? if( hasCountries() ){ ?> <label> <? countryselect( 'j[memberCountry]', @$_POST['j']['memberCountry'] ); ?> Country </label> <? } ?> <label> <input type="text" name="j[memberURL]" value="<?=@$_POST['j']['memberURL']?>"> URL </label> <? if( $_HIVEID['usecodeurl'] ){ ?> <label> <input type="text" name="j[memberCodeURL]" value="<?=@$_POST['j']['memberCodeURL']?>"> Code URL </label> <? } if( $_HIVEID['hivetype'] != 'FANLISTING' ){ ?> <label> <input type="text" name="j[memberTxt1]" value="<?=@$_POST['j']['memberTxt1']?>"> Site Name </label> <? } if( hasQuestion() ) { ?> <label> <input type="text" name="j[memberTxt2]" value="<?=@$_POST['j']['memberTxt2']?>"> <?=hasQuestion()?> </label> <? } if( $_HIVEID['hivetype'] == 'WEBRING' ) { ?> <label> <textarea rows="3" name="j[memberTxt2]" cols="20"><?=@$_POST['j']['memberTxt2']?></textarea> Site Description </label> <? } if ( $_HIVEID['usecom'] ) { ?> <label> <textarea rows="3" name="j[memberCom]" cols="20"><?=@$_POST['j']['memberCom']?></textarea> Comment </label> <? } ?> </fieldset> <fieldset class="submit-button"> <legend>Submit</legend> <label> <input type="submit" name="submit" value="Join!" size="30"> </label> </fieldset> </form> <? } else { ?> <h2>Join</h2> <p> Thank you for your submission, </strong><?=@htmlspecialchars( $_POST['j']['memberName'], ENT_NOQUOTES, "UTF-8" )?></strong>. You should be added in the next update. </p> <? } include( $_HIVEID['footer'] ); ?>
  3. I got the same error; Warning: strtotime() expects parameter 2 to be long, string given in /home/imokon/mirrormatter/queue.php on line 27 id: 2 submitted on Unless I placed the code wrong? <? require("config.php"); $sql = "SELECT * FROM $db_table WHERE queue = '0' ORDER BY id DESC"; $result = mysql_query ($sql); $num_rows = mysql_num_rows($result); echo "<strong>sites in queue</strong> ($num_rows)<br /><br />"; while ($row = mysql_fetch_array($result)) { $added = strtotime("m-d-y",$row["added"]); echo '<a href="'.$row["url"].'" target="_blank">'.$row["site_name"].'</a> id: '.$row["id"].'<br /> submitted on '.$added.'<br /><br />'; } mysql_close(); ?> it used to be; <? require("config.php"); $sql = "SELECT * FROM $db_table WHERE queue = '0' ORDER BY id DESC"; $result = mysql_query ($sql); $num_rows = mysql_num_rows($result); echo "<strong>sites in queue</strong> ($num_rows)<br /><br />"; while ($row = mysql_fetch_array($result)) { $added = date("m-d-y",$row["added"]); echo '<a href="'.$row["url"].'" target="_blank">'.$row["site_name"].'</a> id: '.$row["id"].'<br /> submitted on '.$added.'<br /><br />'; } mysql_close(); ?>
  4. Ok, I copied and pasted the code you just posted. I got the same error. I went ahead and reinstalled the ring just to make sure (deleted and recreated database). I made a new submission, managed to approve it. It's not on the Members page, so I go back to the Queue and I see this error again; sites in queue (2) Warning: date() expects parameter 2 to be long, string given in /home/imokon/mirrormatter/queue.php on line 27 id: 2 submitted on Mirror|Matter Webring id: 1 submitted on 10-16-08 So is it that the script is out of date or something? Thanks for your patience.
  5. Here's what the code looks like now. I got past the approval thing it accepted it etc etc, but when I go to the members page the site is not there. elseif($_POST["action"]=="approve") { $id = $_POST['id']; $sql = "SELECT * FROM $db_table WHERE id=$id"; $result = mysql_query($sql); $sql = "INSERT INTO $db_table (added, password, name, email, site_name, url, description) VALUES ('$added', '$password', '$name', '$email', '$site_name', '$url', '$description')"; $result = mysql_query($sql); $sql = "SELECT * FROM $db_table ORDER BY id DESC LIMIT 1"; $result = mysql_query ($sql); $id = $result['id']; //replace id with whatever the name of your id column is while ($row = mysql_fetch_array($result)) { $to = $row['email']; $subject = "$ring_name Approval"; $message = "Your site has been approved in the $ring_name webring! Thanks for joining!\n\n$admin_name\n$index_php"; if($_POST['password'] == $admin_password) { mysql_query("UPDATE $db_table SET queue='1' WHERE id=$id"); print "<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"3; URL=$index_php\">"; echo "Thanks for your approval! We're taking you back to the main page!"; mail($to,$subject,$message,"From: $admin_email"); } else { echo "Wrong password."; } } } It appears to work fine but when I go to the Members page there's 0 in the queue! Now this is what I get on the Queue page; Warning: date() expects parameter 2 to be long, string given in /home/imokon/mirrormatter/queue.php on line 27 id: 2 submitted on
  6. I thought the column was already "id" from what I've seen? And I place this code where exactly? Do I have to edit it manually each time? $id = $result['id']; //replace id with whatever the name of your id column is
  7. I guess what's boggling my mind is that I looked at the table and it has id as "id", all the applicants info, etc. It was already populated when I submitted info in the first stage. Do I have to redefine the values seen here from earlier in the code, like add another $sql and $result somewhere? $sql = "INSERT INTO $db_table (added, password, name, email, site_name, url, description) VALUES ('$added', '$password', '$name', '$email', '$site_name', '$url', '$description')"; $result = mysql_query($sql); $sql = "SELECT * FROM $db_table ORDER BY id DESC LIMIT 1"; $result = mysql_query ($sql); while ($row = mysql_fetch_array($result)) Also here's a screencap of the table (keep in mind I cleaned out the database, so the id I was trying to approve this time was "1". [attachment deleted by admin]
  8. After rereading this thread a couple more times I realized my last reply was just completely out of context. Anyway I guess I am still stumped even though I have a bit of a better understanding of what the error mysql_fetch_array() is. I've double checked that the value for "id" is consistent throughout. I've tried mysql_fetch_array($result, MYSQL_ASSOC)) and other modifications just incase the fetching wasn't fetching the right way? I've tried to, clear the database and start over just incase... I have made a real effort to understand what the code is exactly trying to say and I guess what is really stumping me now is back to what you said about getting and posting and how to double check...?
  9. I guess I am lost here. This is the email where I am to approve a site (apparently it's id "4") So I am assuming it already assigned the id? Edit: Everything in the database is fine.. hmm.... It says post where it should in this section; echo "Please enter your admin password:<br><br><form method=\"post\" action=\"$PHP_SELF\"><input type=\"hidden\" name=\"id\" value=\"$id\"><input type=\"password\" name=\"password\"><input type=\"submit\" name=\"action\" value=\"approve\"></form>"; } elseif($_GET["action"]=="remove") { echo "Please enter your admin password:<br><br><form method=\"post\" action=\"$PHP_SELF\"><input type=\"hidden\" name=\"id\" value=\"$id\"><input type=\"password\" name=\"password\"><input type=\"submit\" name=\"action\" value=\"delete\"></form>"; }
  10. Almost there! I finally reached the page now where I need to put in my password to confirm approval of a site, but then I get this error; Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/imokon/mirrormatter/process.php on line 137
  11. I just placed it where I wanted it and I get this error; Parse error: syntax error, unexpected T_ELSEIF in /home/imokon/mirrormatter/process.php on line 57 <? { require("config.php"); if($_POST["action"]=="submit") require_once('recaptchalib.php'); $privatekey = "##################"; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { die ("The reCAPTCHA wasn’t entered correctly. Go back and try it again." . "(reCAPTCHA said: " . $resp->error . ")"); } { $added=$_POST['added']; $password=$_POST['password']; $name=$_POST['name']; $email=$_POST['email']; $site_name=$_POST['site_name']; $url=$_POST['url']; $description=$_POST['description']; $sql = "INSERT INTO $db_table (added, password, name, email, site_name, url, description) VALUES ('$added', '$password', '$name', '$email', '$site_name', '$url', '$description')"; $result = mysql_query($sql); $sql = "SELECT * FROM $db_table ORDER BY id DESC LIMIT 1"; $result = mysql_query ($sql); while ($row = mysql_fetch_array($result)) { $id = $row['id']; $password = $_POST['password']; $to = $_POST['email']; $from = "From: $admin_email"; $subject = "$ring_name Submission"; $message = "Thanks for joining the $ring_name webring! Here is your login info, keep this in a safe place!\n\nSite ID: $id\nPassword: $password\n\nDon't forget to put up the ring code on your site as soon as possible! You will not be added to the ring until I find the ring code on your site.\n\nHere's the code:\n\n<a href='http://mirrormatter.imokon.com/index.php?id=1&action=prev'><</a> <a href='http://mirrormatter.imokon.com/index.php?action=rand'>?</a> <a href='http://mirrormatter.imokon.com/index.php?action=home'>Mirror|Matter</a> <a href='http://mirrormatter.imokon.com/index.php?action=list'>#</a> <a href='http://mirrormatter.imokon.com/index.php?id=1&action=next'>></a>\n\nThanks!\n$admin_name\n$ring_url"; $name = $_POST['name']; $url = $_POST['url']; $admin_message = "$name has joined $ring_name! To check this site for your ring code, go to:\n$url\n\nTo approve this new site, go to:\n$ring_url/process.php?id=$id&action=approve\n\nAlternatively, to remove this site, go to:\n$ring_url/process.php?id=$id&action=remove"; if(mail($to,$subject,$message,$from)) { mail($admin_email,$subject,$admin_message,"From: $to"); print"<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"3; URL=$index_php\">"; echo "Thanks for your submission! We're taking you back to the main page!"; } else { echo "There was a problem with your submission. Please check that you filled in the form correctly."; } } } elseif($_POST["action"]=="modify") { require_once('recaptchalib.php'); $privatekey = "##################"; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { die ("The reCAPTCHA wasn’t entered correctly. Go back and try it again." . "(reCAPTCHA said: " . $resp->error . ")"); } { $sql = "SELECT * FROM $db_table WHERE id=$id"; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) { $password1 = $row['password']; $password2 = $_POST['password']; if($password1 == $password2) { mysql_query("UPDATE $db_table SET name='$name', email='$email', site_name='$site_name', url='$url', description='$description' WHERE id='$id'"); print"<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"3; URL=$index_php\">"; echo "Thanks for your modification! We're taking you back to the main page!"; } else { echo "There was a problem with your submission. Please check that you filled in the form correctly."; } } } elseif($_POST["action"]=="remove") { require_once('recaptchalib.php'); $privatekey = "##################"; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { die ("The reCAPTCHA wasn’t entered correctly. Go back and try it again." . "(reCAPTCHA said: " . $resp->error . ")"); } { $sql = "SELECT * FROM $db_table WHERE id=$id"; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) { $password1 = $row['password']; $password2 = $_POST['password']; $to = $row['email']; $url = $row['url']; if($password1 == $password2) { mysql_query("DELETE FROM $db_table WHERE id=$id"); $from = "From: $admin_email"; $subject = "Site Deleted From $ring_name"; $message = "Your site has been deleted from $ring_name upon your request. Sorry you decided to go!\n\n$admin_name\n$index_php"; $admin_message = "The site located at $url has been deleted upon the owner's request."; if(mail($to,$subject,$message,$from)) { mail($admin_email,$subject,$admin_message,"From: $to"); print"<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"3; URL=$index_php\">"; echo "You've been deleted from $ring_name. Sorry to see you go!"; } else { echo "There was a problem with your submission. Please check that you filled in the form correctly."; } } else { echo "There was a problem with your submission. Please check that you filled in the form correctly."; } } } elseif($_POST["action"]=="approve") { $id = $_POST['id']; $sql = "SELECT * FROM $db_table WHERE id=$id"; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) { $to = $row['email']; $subject = "$ring_name Approval"; $message = "Your site has been approved in the $ring_name webring! Thanks for joining!\n\n$admin_name\n$index_php"; if($_POST['password'] == $admin_password) { mysql_query("UPDATE $db_table SET queue='1' WHERE id=$id"); print "<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"3; URL=$index_php\">"; echo "Thanks for your approval! We're taking you back to the main page!"; mail($to,$subject,$message,"From: $admin_email"); } else { echo "Wrong password."; } } } elseif($_POST["action"]=="delete") { $id = $_POST['id']; $sql = "SELECT * FROM $db_table WHERE id=$id"; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) { $to = $row['email']; $site = $row['site_name']; $subject = "$ring_name Deletion"; $message = "Your site has been deleted from the $ring_name webring! If you have any questions about why your site was deleted, respond to this email.\n\n$admin_name\n$index_php"; if($_POST['password'] == $admin_password) { mysql_query("DELETE FROM $db_table WHERE id=$id"); print "<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"3; URL=$index_php\">"; echo "$site has been deleted from the webring!"; mail($to,$subject,$message,"From: $admin_email"); } else { echo "Wrong password."; } } } elseif($_GET["action"]=="approve") { echo "Please enter your admin password:<br><br><form method=\"post\" action=\"$PHP_SELF\"><input type=\"hidden\" name=\"id\" value=\"$id\"><input type=\"password\" name=\"password\"><input type=\"submit\" name=\"action\" value=\"approve\"></form>"; } elseif($_GET["action"]=="remove") { echo "Please enter your admin password:<br><br><form method=\"post\" action=\"$PHP_SELF\"><input type=\"hidden\" name=\"id\" value=\"$id\"><input type=\"password\" name=\"password\"><input type=\"submit\" name=\"action\" value=\"delete\"></form>"; } else { echo "No variable passed."; } ?>
  12. I have three if's I want it to apply to, the Submit, Modify, and the first Remove. The rest of the If's are 2 Approves, Delete, and the 2nd Remove. Where would I place the reCAPTCHA script? or do I put it at every If I want it to apply to?
  13. Hello there, I browsed your forums after scouring the net and the recaptcha forums and I found a few things on reCAPTCHA but nothing that I think helps with what I am looking for. I will try to explain this to the best of my ability; I am working on a site with a webring php script, I have the reCAPTCHA up and running, everything works fine. The problem arises when I get emails from the process.php that let me know who submitted a request to join the webring, and whether to approve or delete their application. Now what I believe is that the reCAPTCHA script which is placed at the top of the process.php script, it is interfering (obviously) with everything the process does (which it shouldn't?) including what it does when the person trying to join the ring (as it should). With that said, how would I place the reCAPTCHA script in the body of the email being sent to me if I can't obviously include it (recaptchalib.php) which it needs to run? I was thinking maybe I can validate my action that way - OR - is there a way to limit the reCAPTCHA script in the process.php to only affect the form submissions and not the links that i need to click on from my end? Any help is greatly appreciated. I am self-taught and by no means an expert so excuse any ignorance :/ Here is the link to said form (no frontal nudity whatsoever but just incase not safe for work) http://mirrormatter.imokon.com/join.php And here is my process source code; <?php require_once('recaptchalib.php'); $privatekey = "##########################"; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { die ("The reCAPTCHA wasn’t entered correctly. Go back and try it again." . "(reCAPTCHA said: " . $resp->error . ")"); } ?> <? require("config.php"); if($_POST["action"]=="submit") { $added=$_POST['added']; $password=$_POST['password']; $name=$_POST['name']; $email=$_POST['email']; $site_name=$_POST['site_name']; $url=$_POST['url']; $description=$_POST['description']; $sql = "INSERT INTO $db_table (added, password, name, email, site_name, url, description) VALUES ('$added', '$password', '$name', '$email', '$site_name', '$url', '$description')"; $result = mysql_query($sql); $sql = "SELECT * FROM $db_table ORDER BY id DESC LIMIT 1"; $result = mysql_query ($sql); while ($row = mysql_fetch_array($result)) { $id = $row['id']; $password = $_POST['password']; $to = $_POST['email']; $from = "From: $admin_email"; $subject = "$ring_name Submission"; $message = "Thanks for joining the $ring_name webring! Here is your login info, keep this in a safe place!\n\nSite ID: $id\nPassword: $password\n\nDon't forget to put up the ring code on your site as soon as possible! You will not be added to the ring until I find the ring code on your site.\n\nHere's the code:\n\n<a href='http://mirrormatter.imokon.com/index.php?id=1&action=prev'><</a> <a href='http://mirrormatter.imokon.com/index.php?action=rand'>?</a> <a href='http://mirrormatter.imokon.com/index.php?action=home'>Mirror|Matter</a> <a href='http://mirrormatter.imokon.com/index.php?action=list'>#</a> <a href='http://mirrormatter.imokon.com/index.php?id=1&action=next'>></a>\n\nThanks!\n$admin_name\n$ring_url"; $name = $_POST['name']; $url = $_POST['url']; $admin_message = "$name has joined $ring_name! To check this site for your ring code, go to:\n$url\n\nTo approve this new site, go to:\n$ring_url/process.php?id=$id&action=approve\n\nAlternatively, to remove this site, go to:\n$ring_url/process.php?id=$id&action=remove"; if(mail($to,$subject,$message,$from)) { mail($admin_email,$subject,$admin_message,"From: $to"); print"<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"3; URL=$index_php\">"; echo "Thanks for your submission! We're taking you back to the main page!"; } else { echo "There was a problem with your submission. Please check that you filled in the form correctly."; } } } elseif($_POST["action"]=="modify") { $sql = "SELECT * FROM $db_table WHERE id=$id"; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) { $password1 = $row['password']; $password2 = $_POST['password']; if($password1 == $password2) { mysql_query("UPDATE $db_table SET name='$name', email='$email', site_name='$site_name', url='$url', description='$description' WHERE id='$id'"); print"<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"3; URL=$index_php\">"; echo "Thanks for your modification! We're taking you back to the main page!"; } else { echo "There was a problem with your submission. Please check that you filled in the form correctly."; } } } elseif($_POST["action"]=="remove") { $sql = "SELECT * FROM $db_table WHERE id=$id"; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) { $password1 = $row['password']; $password2 = $_POST['password']; $to = $row['email']; $url = $row['url']; if($password1 == $password2) { mysql_query("DELETE FROM $db_table WHERE id=$id"); $from = "From: $admin_email"; $subject = "Site Deleted From $ring_name"; $message = "Your site has been deleted from $ring_name upon your request. Sorry you decided to go!\n\n$admin_name\n$index_php"; $admin_message = "The site located at $url has been deleted upon the owner's request."; if(mail($to,$subject,$message,$from)) { mail($admin_email,$subject,$admin_message,"From: $to"); print"<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"3; URL=$index_php\">"; echo "You've been deleted from $ring_name. Sorry to see you go!"; } else { echo "There was a problem with your submission. Please check that you filled in the form correctly."; } } else { echo "There was a problem with your submission. Please check that you filled in the form correctly."; } } } elseif($_POST["action"]=="approve") { $id = $_POST['id']; $sql = "SELECT * FROM $db_table WHERE id=$id"; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) { $to = $row['email']; $subject = "$ring_name Approval"; $message = "Your site has been approved in the $ring_name webring! Thanks for joining!\n\n$admin_name\n$index_php"; if($_POST['password'] == $admin_password) { mysql_query("UPDATE $db_table SET queue='1' WHERE id=$id"); print "<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"3; URL=$index_php\">"; echo "Thanks for your approval! We're taking you back to the main page!"; mail($to,$subject,$message,"From: $admin_email"); } else { echo "Wrong password."; } } } elseif($_POST["action"]=="delete") { $id = $_POST['id']; $sql = "SELECT * FROM $db_table WHERE id=$id"; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) { $to = $row['email']; $site = $row['site_name']; $subject = "$ring_name Deletion"; $message = "Your site has been deleted from the $ring_name webring! If you have any questions about why your site was deleted, respond to this email.\n\n$admin_name\n$index_php"; if($_POST['password'] == $admin_password) { mysql_query("DELETE FROM $db_table WHERE id=$id"); print "<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"3; URL=$index_php\">"; echo "$site has been deleted from the webring!"; mail($to,$subject,$message,"From: $admin_email"); } else { echo "Wrong password."; } } } elseif($_GET["action"]=="approve") { echo "Please enter your admin password:<br><br><form method=\"post\" action=\"$PHP_SELF\"><input type=\"hidden\" name=\"id\" value=\"$id\"><input type=\"password\" name=\"password\"><input type=\"submit\" name=\"action\" value=\"approve\"></form>"; } elseif($_GET["action"]=="remove") { echo "Please enter your admin password:<br><br><form method=\"post\" action=\"$PHP_SELF\"><input type=\"hidden\" name=\"id\" value=\"$id\"><input type=\"password\" name=\"password\"><input type=\"submit\" name=\"action\" value=\"delete\"></form>"; } else { echo "No variable passed."; } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.