Raised This Month: $ Target: $400
 0% 

Form and Redirecting PHP/HTML Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 05-27-2011 , 03:00   Form and Redirecting PHP/HTML Help
Reply With Quote #1

I need help. I am trying to create a php script for mobile devices so when u enter ur username and password and press login, it will submit the values of the form to "" and if the value is correct it will redirect to another site. I understand this might reqiure http request

PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">

<
head>
    <
meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
<
title>Ormiston Mobile Site</title>
    
    <
META NAME="Author" CONTENT="">
    <
meta name="keywords" content="">
    <
meta name="HandheldFriendly" content="true">
    <
meta name="MobileOptimized" content="220">
    <
meta name="viewport" content="width=320">
</
head>

<
style>
h2{
    
letter-spacing: -1px;
    
font-familyarial,verdana,sans-serif;
    
margin1.2em 0 .3em;
    
color#f28812;
    
border-bottom1px solid #eee;
    
padding-bottom.1em;
}
</
style>

<
body bgcolor="f7f6f6">
<
center>
<
img src="images/" width="260" border="0" class="center">

<
h2 style="break: both;"Enter your username and password</h2
</
center>

    <
form action="" method="post" name="f"
    <
center>
    <
table
        <
tr
            <
td rowspan="3"></td
            <
td style="padding: .3em;">Username</td
            <
td
<
input type="text" id="username" tabindex="1" name="username" value="" />            </td
            <
td style="padding: .4em;" rowspan="3"
                <
input type="submit" tabindex="4" value="Login" />            </td
        </
tr
        <
tr
            <
td style="padding: .3em;">Password</td
            <
td><input id="password" type="password" tabindex="2" name="password" /></td
        </
tr
    </
table>
    </
center
 
</
br>
    </
form


<
p style="line-height: 150%">
</
p>
</
body>
</
html
__________________
JailBreak Mod with Plugin API ( 90% ) Public

Last edited by shuttle_wave; 06-15-2016 at 23:50.
shuttle_wave is offline
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 05-27-2011 , 03:12   Re: Form and Redirecting PHP/HTML Help
Reply With Quote #2

here is the loginuserpass from that site.

PHP Code:
<?php

/**
 * This page shows a username/password login form, and passes information from it
 * to the sspmod_core_Auth_UserPassBase class, which is a generic class for
 * username/password authentication.
 *
 * @author Olav Morken, UNINETT AS.
 * @package simpleSAMLphp
 * @version $Id$
 */

if (!array_key_exists('AuthState'$_REQUEST)) {
    throw new 
SimpleSAML_Error_BadRequest('Missing AuthState parameter.');
}
$authStateId $_REQUEST['AuthState'];

/* Retrieve the authentication state. */
$state SimpleSAML_Auth_State::loadState($authStateIdsspmod_core_Auth_UserPassBase::STAGEID);


$source SimpleSAML_Auth_Source::getById($state[sspmod_core_Auth_UserPassBase::AUTHID]);
if (
$source === NULL) {
    throw new 
Exception('Could not find authentication source with id ' $state[sspmod_core_Auth_UserPassBase::AUTHID]);
}


if (
array_key_exists('username'$_REQUEST)) {
    
$username $_REQUEST['username'];
} elseif (isset(
$state['core:username'])) {
    
$username = (string)$state['core:username'];
} else {
    
$username '';
}

if (
array_key_exists('password'$_REQUEST)) {
    
$password $_REQUEST['password'];
} else {
    
$password '';
}

if (!empty(
$_REQUEST['username']) || !empty($password)) {
    
/* Either username or password set - attempt to log in. */

    
if (array_key_exists('forcedUsername'$state)) {
        
$username $state['forcedUsername'];
    }

    
$errorCode sspmod_core_Auth_UserPassBase::handleLogin($authStateId$username$password);
} else {
    
$errorCode NULL;
}

$globalConfig SimpleSAML_Configuration::getInstance();
$t = new SimpleSAML_XHTML_Template($globalConfig'core:loginuserpass.php');
$t->data['stateparams'] = array('AuthState' => $authStateId);
if (
array_key_exists('forcedUsername'$state)) {
    
$t->data['username'] = $state['forcedUsername'];
    
$t->data['forceUsername'] = TRUE;
} else {
    
$t->data['username'] = $username;
    
$t->data['forceUsername'] = FALSE;
}
$t->data['links'] = $source->getLoginLinks();
$t->data['errorcode'] = $errorCode;

if (isset(
$state['SPMetadata'])) {
    
$t->data['SPMetadata'] = $state['SPMetadata'];
} else {
    
$t->data['SPMetadata'] = NULL;
}

$t->show();
exit();


?>
the file mobile web script will be placed on a different webserver.
__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
8088
Veteran Member
Join Date: Jan 2008
Old 05-27-2011 , 12:21   Re: Form and Redirecting PHP/HTML Help
Reply With Quote #3

http://www.elance.com
__________________
steamID converter with OpenSearch browser plugin
8088 is offline
ARES[ro]
Senior Member
Join Date: Apr 2010
Old 05-27-2011 , 17:09   Re: Form and Redirecting PHP/HTML Help
Reply With Quote #4

Alright, im trying to connect to that link to get the form action cuz that is the key, but i cannot actually go in, post a LINK in your first post correctly.
__________________
okay

Last edited by ARES[ro]; 05-27-2011 at 17:15.
ARES[ro] is offline
shuttle_wave
Veteran Member
Join Date: Apr 2009
Location: New Zealand
Old 05-27-2011 , 21:41   Re: Form and Redirecting PHP/HTML Help
Reply With Quote #5

Quote:
Originally Posted by ARES[ro] View Post
Alright, im trying to connect to that link to get the form action cuz that is the key, but i cannot actually go in, post a LINK in your first post correctly.
updated
__________________
JailBreak Mod with Plugin API ( 90% ) Public
shuttle_wave is offline
8088
Veteran Member
Join Date: Jan 2008
Old 05-27-2011 , 22:21   Re: Form and Redirecting PHP/HTML Help
Reply With Quote #6

My humble advice:
  1. leave managing of cq. securing sensitive data to people who know what they're doing
  2. find out what http requests actually are
  3. do some research
  4. don't use random code snippets
  5. when asking for help, post relevant code
  6. when asking for help, describe the problem that you need help with
__________________
steamID converter with OpenSearch browser plugin
8088 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:33.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode