Beispiel #1
0
function randomDigits($numDigits)
{
    if ($numDigits <= 0) {
        return '';
    }
    return mt_rand(1, 9) . randomDigits($numDigits - 1);
}
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
include_once 'includes/functions.php';
include_once 'includes/dbfront.php';
$pdo = connect();
// get function to retrieve user's firstName with specified parameter as sub
if (isset($_GET['get'])) {
    $sub = $_GET['get'];
    $user = getUser($pdo, $sub);
    echo $user['firstName'];
    return;
}
// initiate session
sec_session_start();
// generate random number for a state parameter
$state = randomDigits(7);
// if a proxy value is in POST parameters, add a 'p' in the state value
if (isset($_POST['proxy'])) {
    $state = "p" . $state;
}
// put the state value in the session cookies
if ($state) {
    // $_SESSION['oidc_state'] = $state;
    setcookie('oidc_state', $state, 0, '/');
}
//echo "Location: $IDP_URL/auth?client_id=$CLIENT_ID&response_type=$RESPONSE_TYPE&redirect_uri=$REDIRECT_URI&scope=$SCOPE&state=$state";
// redirect to the Identity Provider
header("Location: {$IDP_URL}/auth?client_id={$CLIENT_ID}&response_type={$RESPONSE_TYPE}&redirect_uri={$REDIRECT_URI}&scope={$SCOPE}&state={$state}");
Beispiel #3
0
    ?>
  								 
  								 <button id="Exit" onClick="location.replace('logout.php?logoff=logoff');" class="btn btn-danger">
									Oppsy - You Have a Pending Transaction clear it to avoid double payment
  								 </button>


					  

					 <?php 
} else {
    ?>
                    <img src="images/interswitch_logo.png" alt="interswitch_logo">
                    <br>
                    <?php 
    $randomDigit = randomDigits(4);
    $transaction_id = substr($randomDigit, 0, 2) . $result["form_id"] . substr($randomDigit, 2, 2);
    $_SESSION["transaction_id"] = $transaction_id;
    $return_url = 'http://' . $_SERVER['HTTP_HOST'] . '/mis.unijos.edu.ng/app_form_template/processpayment.php';
    $total_kobo = $our_total;
    $hash_value = $transaction_id . '3944' . $payment_id . $total_kobo . $return_url . "CF82609ADB4A2352966649823625C1217BE486E1B23D4686621EFED077B0B42924B2098F0B36656BAC8B6008576BF05A254B244675B501DA3DF863311BF1BB75";
    //echo  $hash_value . "<br>";
    $ourhas = hash("sha512", $hash_value);
    ?>
                    <form name="regform" id="form1" method="POST" action="https://webpay.interswitchng.com/paydirect/webpay/pay.aspx" onsubmit="return createTargeter(this.target, 600, 650);" target="new_window">
                    <?php 
    echo '
                    	<input name="product_id" type="hidden" value="3944" /> 
                        <input name="pay_item_id" type="hidden" value="' . $payment_id . '" />
                        <input name="amount" id="total_kobo" type="hidden" value="' . $total_kobo . '" />
                        <input name="currency" type="hidden" value="566" />
Beispiel #4
0
  				<?php 
        echo $gen["genre"];
        ?>
</option>
		<?php 
    }
    ?>
		</select><br />
		Rank <input name="rank" type="number" step="0.1" min="0" max="10"
				pattern="^[+]?\d+(,\d{2})?" required="required" placeholder="n.n" /><br /> 
		id: <select name="movID" id="movID">
  			<option value="<?php 
    echo randomDigits(4);
    ?>
"><?php 
    echo randomDigits(4);
    ?>
</option>
		</select><br />
		<input type="submit" value="go" />
	</div>
</fieldset>
</form>

<?php 
} catch (PDOException $ex) {
    ?>
  <p>Sorry, a database error occurred. Please try again later.</p>
  <p>(Error details: <?php 
    echo $ex->getMessage();
    ?>