Note that there are some explanatory texts on larger screens.

plurals
  1. POisset function in php
    primarykey
    data
    text
    <p>i was wondering if it 'is possible to get two isset function to work in 1 php file?' and if not how to combine two isset function into one? is there a simpler way to validate both recaptcha and the activation code in db? much thanks if anyone could guide me with a simpler way...</p> <p>Here is my current code recaptcha code:</p> <pre><code> if (isset($_POST["recaptcha_response_field"])) { $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if ($resp-&gt;is_valid) { echo "Account activated"; } else { # set the error code so that we can display it $error = $resp-&gt;error; echo "please try again"; } } echo recaptcha_get_html($publickey, $error); </code></pre> <p>i would like to validate the registered user activation code as well so i created this:</p> <pre><code>if (isset($_GET['success']) === true &amp;&amp; empty($_GET['success']) === true) { ?&gt; &lt;h2&gt; Account activated! &lt;/h2&gt; &lt;?php } else if (isset($_GET['email'], $_GET['activation_code']) === true) { $email = trim($_GET['email']); $activation_code = trim($_GET['activation_code']); if (emailadd_exists($email) === false) { $errors[] = 'Email address cannot be found'; } else if (activate($email, $activation_code) === false) { $errors[] = 'Problem encountered activating your account'; } if (empty($errors) === false) { ?&gt; &lt;h2&gt; Oops &lt;/h2&gt; &lt;?php echo output_errors($errors); } else { header('Location: index.php'); exit(); } } else { echo 'error'; exit(); } ?&gt; &lt;br/&gt; &lt;br/&gt; &lt;form action="" method="post"&gt; &lt;ul&gt; &lt;li&gt; Activation code:&lt;br&gt; &lt;input name="activation_code" type="text"&gt;&lt;br/&gt; &lt;input type="submit" value="Verify" /&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/form&gt; </code></pre> <p>how to combine the two isset function? or is there a simpler to do this... please guide me. thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload