Nov 8, 2009

Php Sessions And Post Variables Issues - My script dosent seem to work as intended

free web hosting
Open Discussion > MODERATED AREA > Computers > Programming Languages > PHP Programming

Php Sessions And Post Variables Issues - My script dosent seem to work as intended

sonesay
You can test it out for yourself at http://sonesay.trap17.com/application.php

I've been working on this page locally and it seems to be working fine but when I upload it to my trap17 account the post variables dont get saved properly. Fill in some fields and submit it, the form will come up as a empty field yet when you resubmit it without any modifications and the data you entered in orginally will now magically appear, resubmit it again and it will be gone.

This is really annoying as I have no clue why it would be doing this when it seems to work fine locally.

application.php
CODE
<?php
/*

Application page
===================
uses _core.php
uses includes/application_content.php for content


*/
session_start();
include('db.php');



// page settings
$title = 'Application';
$location = 'application.php';
$lu_title = 'Login';
$ru_title = 'News';
$lp_title = 'Navigation';
$cp_title = $title;
$rp_title = 'Events';

$content = 'includes/application_content.php';


include('_core.php');

?>


_core.php
CODE
<?php


// output page

echo "<!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' />
&lt;script type='text/javascript' src='ext-1.1.1/adapter/yui/yui-utilities.js'></script>
&lt;script type='text/javascript' src='ext-1.1.1/adapter/yui/ext-yui-adapter.js'></script>
&lt;script type='text/javascript' src='ext-1.1.1/ext-all-debug.js'></script>

&lt;script type='text/javascript' src='jquery-1.2.1.min.js'></script>
&lt;script type='text/javascript' src='date.js'></script>
<!--[if IE]>&lt;script type='text/javascript' src='jquery.bgiframe.min.js'></script><![endif]-->
&lt;script type='text/javascript' src='jquery.datePicker.js'></script>

<link href='nexus_main.css' rel='stylesheet' type='text/css' />
<link rel='stylesheet' type='text/css' media='screen' href='datePicker.css'>
<link rel='stylesheet' type='text/css' media='screen' href='demo.css'>

<title>$title</title>
</head>


<body>


<div id='upper_bg'>
</div>
<div id='outer'>
<!-- main container -->


<div id='header'>
<div id='upper_left_pan'>
<div id='upper_left_title'>$lu_title</div>
<div id='upper_left_content'>
<div id='login_section'>
<p>
Not logged in, Please login below <br />
Username: <input type='text' /><br />
Password: <input type='password' /><br />
<button disabled='disabled'>Login</button>
</p>
</div>
</div>
</div>
<div id='header_right_pan'>
<div id='upper_right_title'>$ru_title</div>
<div id='upper_right_content'><p>No news to display</p></div>
</div>

</div>


<!-- content container -->


<div id='content'>
<div id='left_pan'>

<div class='side_panel_top'>
<div class='side_panel_title'>$lp_title</div>
</div>
<div class='side_panel_middle'>


";


// include navigation
include('includes/nav_list.php');


echo "


</div>
<div class='side_panel_bottom'>
</div>



</div>
<div id='right_pan'>
<div class='side_panel_top'>
<div class='side_panel_title'>$rp_title</div>
</div>
<div class='side_panel_middle'>
<div class='side_panel_right_content'>
<p>
No Current events to display.
</p>
</div>
</div>
<div class='side_panel_bottom'>
</div>
</div>
<div id='middle_pan'>
<div class='center_panel_top'>
<div class='center_panel_title'>$cp_title</div>
</div>

<div class='center_panel_middle'>
<div class='center_panel_content'>";

// Content includes
if($content != '') {
include($content);
}




echo"

</div>
</div>

<div class='center_panel_bottom'>
</div>

</div>



</div>



<!-- main container end -->
</div>

</body>
</html>";
// end page

?>



application_content.php
CODE
<?php
/*
Description
------------
File contains an application form for users to register, Is used by application.php



Contents
----------
1. Functions

2. Application Form
// Part 1
2.1 Display Empty form
2.2 Check and Dsiplay form with any ERRORS if any
2.2.1 display form with errors
2.2.2 display from with no errors, user has to confirm info then moved to Part 2
// Part 2
2.3 display details from part 1 (just for display pruposes making sure details are stored.)

*/
$s = $_SESSION;
include('includes/class/userClass.php');



// 1. FUNCTIONS

function ck_app_username($uname) {

global $link;

// check if user already exisit
$user_ck_query = "SELECT u_name FROM user WHERE u_name ='" . $uname . "'";
$user_ck_result = mysql_query($user_ck_query, $link);

$ck_result = "Default";
$pattern = "/[!|@|#|$|%|^|&|*|(|)|_|\-|=|+|\||,|.|\/|;|:|\'|\"|\[|\]|\{|\}]/i";

// check for input
if($uname == '') {
$ck_result = "<span class='error_header'>Required!</span>";
$app_errors['username'] = true;
}
else if (preg_match($pattern, $uname)) {
$ck_result = "<span class='error_header'>illegal characters</span>";
$app_errors['username'] = true;
}
else if (preg_match("/[0-9]/", $uname)) {
$ck_result = "<span class='error_header'>No numbers in username!</span>";
$app_errors['username'] = true;
}
else if (strlen($uname) < 3) {
$ck_result = "<span class='error_header'>3 Characters minimun!</span>";
$app_errors['username'] = true;
}
else if (mysql_num_rows($user_ck_result) > 0) {
$ck_result = "<span class='error_header'>User Exist!</span>";
$app_errors['username'] = true;
}
else {
$ck_result = "<span class='ok_header'>Available</span>";
unset($app_errors['username']);
}

return $ck_result;
}


function ck_app_password($pwd,$cpwd) {
// version 1.0
$app_password_result = "default";

// check password
if($pwd == '' || $cpwd == '') {
$app_password_result = "<span class='error_header'>Enter password and confirm!</span>";
$app_errors['password'] = true;
}
// user submitted something
else if ($pwd != $cpwd) {
$app_password_result = "<span class='error_header'>Passwords do not match!</span>";
$app_errors['password'] = true;
}
// check for minimun chars for password 6
else if (strlen($pwd) < 6) {
$app_password_result = "<span class='error_header'>Passwords must be 6 characters or more!</span>";
$app_errors['password'] = true;
}
// all checks done password ok
else {
$app_password_result = "<span class='ok_header'>OK!</span>";
unset($app_errors['password']);
}

// return result
return $app_password_result;
}


function ck_name($name) {
$ck_name_result = 'Default';
$regex = "/[^a-zA-Z]/";


if($name == '') {
$ck_name_result = "<span class='error_header'>Required!</span>";
$app_errors['name'] = true;

}
else if(preg_match($regex,$name)) {
$ck_name_result = "<span class='error_header'>Error. a-z A-Z only!</span>";
$app_errors['name'] = true;
}
else {

$ck_name_result = "<span class='ok_header'>OK</span>";
unset($app_errors['name']);
}
return $ck_name_result;
}



function ck_email ($mail) {
//default
$ck_email_result = "Default";
//pattern
$regex = '/\A(?:[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+'
.'(?:\.[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+)*@'
.'(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[a-z]{2}|'
.'com|org|net|gov|biz|info|name|aero|biz|info|jobs|'
.'museum)\b)\Z/i';

if ($mail == '') {
$ck_email_result = "<span class='error_header'>Email Required!</span>";
$app_errors['email'] = true;
}
else if (preg_match($regex, $mail)) {
$ck_email_result = "<span class='ok_header'>OK!</span>";
$app_errors['email'] = true;
}
else {
$ck_email_result = "<span class='error_header'>Invalid Emai!</span>";
unset($app_errors['email']);
}

return $ck_email_result;
}

// END FUNCTIONS =======



// 2. APPLICATION FORM ================================================================================
============


// 2.1 DISPLAY EMPTY FORM
if(count($p) == 0) {
echo "
<h1>Personal Details - Part 1 of 5</h1>
<p>
Fill in all the fields below. Make sure you have read and understood the <a href='rules.php'>rules</a> before posting an application to join the Linkshell(s).
</p>

<form name=\"app_form\" method=\"post\" action=\"application.php\">
<input type=\"hidden\" name=\"app_stage\" value=\"1\" />


<ul class=\"app_details\">
<li class=\"col1\">Desired Username</li>
<li><input type=\"text\" name=\"app_username\" /></li>
</ul>
<ul class=\"app_details\">
<li class=\"col1\">Password</li>
<li><input type=\"password\" name=\"app_password\" /></li>
</ul>
<ul class=\"app_details\">
<li class=\"col1\">Comfirm Password</li>
<li><input type=\"password\" name=\"app_cpassword\" /></li>
</ul>

<ul class=\"app_details\">
<li class=\"col1\">First Name</li>
<li><input type=\"text\" name=\"app_fname\" /></li>
</ul>
<ul class=\"app_details\">
<li class=\"col1\">Last Name</li>
<li> <input type=\"text\" name=\"app_lname\" /></li>
</ul>


&lt;script language='javascript' type='text/javascript'>
$(function()
{
$('.date-pick').datePicker({startDate:'01/01/1950'});
});
</script>

<ul class=\"app_details\">
<li class=\"col1\">DOB</li>
<li><input type=\"text\" size=\"10\" name=\"app_dob\" class='date-pick' value='' readonly='readonly' /></li>
</ul>

<ul class=\"app_details\">
<li class=\"col1\">Gender</li>
<li> <select name=\"app_gender\" />
<option value=\"m\">Male</option>
<option value=\"f\">female</option>
</select>
</li>
</ul>

<ul class=\"app_details\">
<li class=\"col1\">Email</li>
<li> <input type=\"text\" name=\"app_email\" /> $email_result</li>
</ul>

<ul class=\"app_details\">
<li class=\"col1\"></li>
<li><button>Submit</button></li>
</ul>
</form>
";
}


// 2.2 Display form with any errors ============================================

else if((count($p) > 0) && ($p['app_stage'] < 2 )){

$app_username = strtolower($p['app_username']);
$_SESSION['app_username'] = htmlspecialchars($app_username);
$_SESSION['app_password'] = $p['app_password'];
$_SESSION['app_cpassword'] = $p['app_cpassword'];
$_SESSION['app_fname'] = $p['app_fname'];
$_SESSION['app_lname'] = $p['app_lname'];
$_SESSION['app_gender'] = $p['app_gender'];
$_SESSION['app_dob'] = $p['app_dob'];
$_SESSION['app_email'] = $p['app_email'];

if ($p['app_stage'] == 1) {
// check results
if(!isset($s['app_errors'])) {
$s['app_errors'] = array();
}
$app_errors = $s['app_errors'];
//username
$username_result = ck_app_username($s['app_username']);
if($username_result == "<span class='ok_header'>Available</span>") {
unset($app_errors['username']);
}
else{
$app_errors['username'] = true;
}
//password
$password_result = ck_app_password($s['app_password'],$s['app_cpassword']);
if($password_result == "<span class='ok_header'>OK!</span>") {
unset($app_errors['password']);
}
else{
$app_errors['password'] = true;
}
// names
$fname_result = ck_name($s['app_fname']);
$lname_result = ck_name($s['app_lname']);
//email
$email_result = ck_email($s['app_email']);
if($email_result == "<span class='ok_header'>OK!</span>") {
unset($app_errors['email']);
}
else{
$app_errors['email'] = true;
}



// 2.2.1 Display application with ERRORS ==========================================
if(count($app_errors) > 0) {

echo "

<h1>Personal Details - Part 1 of 5</h1>

<p>
There are <span class='error_header'>errors</span> please correct and resubmit.
</p>


<form name=\"app_form\" method=\"post\" action=\"application.php\">
<input type=\"hidden\" name=\"app_stage\" value=\"1\" />


<ul class=\"app_details\">
<li class=\"col1\">Desired Username</li>
<li><input type=\"text\" name=\"app_username\" value=\"{$s['app_username']}\" /> $username_result</li>
</ul>
<ul class=\"app_details\">
<li class=\"col1\">Password</li>
<li><input type=\"password\" name=\"app_password\" value=\"{$s['app_password']}\" /></li>
</ul>
<ul class=\"app_details\">
<li class=\"col1\">Comfirm Password</li>
<li><input type=\"password\" name=\"app_cpassword\" value=\"{$s['app_cpassword']}\" /> $password_result</li>
</ul>

<ul class=\"app_details\">
<li class=\"col1\">First Name</li>
<li><input type=\"text\" name=\"app_fname\" value=\"{$s['app_fname']}\" /> $fname_result</li>
</ul>
<ul class=\"app_details\">
<li class=\"col1\">Last Name</li>
<li> <input type=\"text\" name=\"app_lname\" value=\"{$s['app_lname']}\" /> $lname_result</li>
</ul>



&lt;script language='javascript' type='text/javascript'>
$(function()
{
$('.date-pick').datePicker({startDate:'01/01/1950'});
});
</script>



<ul class=\"app_details\">
<li class=\"col1\">DOB</li>
<li><input type=\"text\" size=\"10\" name=\"app_dob\" value=\"{$s['app_dob']}\" class='date-pick' readonly='readonly' />
</li>
</ul>

<ul class=\"app_details\">
<li class=\"col1\">Gender</li>
<li> <select name=\"app_gender\" />
";
// check if gender selected
if($p['app_gender'] == 'f') {
echo "<option value=\"f\">female</option>
<option value=\"m\">Male</option>
";
}
else {
echo "<option value=\"m\">Male</option>
<option value=\"f\">female</option>
";
}



echo "
</select>
</li>
</ul>

<ul class=\"app_details\">
<li class=\"col1\">Email</li>
<li> <input type=\"text\" name=\"app_email\" value=\"{$s['app_email']}\" /> $email_result </li>
</ul>

<ul class=\"app_details\">
<li class=\"col1\"></li>
<li>
<button>Re-submit</button>
</li>
</ul>
</form>
";
}
// 2.2.2 Display application form with 0 ERRORS ==========================================
else {



echo "

<h1>Personal Details - Part 1 of 5</h1>
<p>
Please confirm details and submit, If there are any changed needed to be made hit the back button now.
</p>


<form name=\"app_form\" method=\"post\" action=\"application.php\">
<input type=\"hidden\" name=\"app_stage\" value=\"2\" />


<ul class=\"app_details\">
<li class=\"col1\">Desired Username</li>
<li><input type=\"text\" name=\"app_username\" value=\"{$s['app_username']}\" disabled='disabled' /> $username_result</li>
</ul>
<ul class=\"app_details\">
<li class=\"col1\">Password</li>
<li><input type=\"password\" name=\"app_password\" value=\"{$s['app_password']}\" disabled='disabled' /></li>
</ul>
<ul class=\"app_details\">
<li class=\"col1\">Comfirm Password</li>
<li><input type=\"password\" name=\"app_cpassword\" value=\"{$s['app_cpassword']}\" disabled='disabled' /> $password_result</li>
</ul>

<ul class=\"app_details\">
<li class=\"col1\">First Name</li>
<li><input type=\"text\" name=\"app_fname\" value=\"{$s['app_fname']}\" disabled='disabled' /> $fname_result</li>
</ul>
<ul class=\"app_details\">
<li class=\"col1\">Last Name</li>
<li> <input type=\"text\" name=\"app_lname\" value=\"{$s['app_lname']}\" disabled='disabled' /> $lname_result</li>
</ul>



&lt;script language='javascript' type='text/javascript'>
$(function()
{
$('.date-pick').datePicker({startDate:'01/01/1950'});
});
</script>



<ul class=\"app_details\">
<li class=\"col1\">DOB</li>
<li><input type=\"text\" size=\"10\" name=\"app_dob\" value=\"{$s['app_dob']}\" disabled='disabled' />
</li>
</ul>

<ul class=\"app_details\">
<li class=\"col1\">Gender</li>
<li> <select name=\"app_gender\" disabled='disabled'/>
";
// check if gender selected
if($p['app_gender'] == 'f') {
echo "<option value=\"f\" >female</option>
<option value=\"m\">Male</option>
";
}
else {
echo "<option value=\"m\" >Male</option>
<option value=\"f\">female</option>
";
}



echo "
</select>
</li>
</ul>

<ul class=\"app_details\">
<li class=\"col1\">Email</li>
<li> <input type=\"text\" name=\"app_email\" value=\"{$s['app_email']}\" disabled='disabled' /> $email_result </li>
</ul>

<ul class=\"app_details\">
<li class=\"col1\"></li>
<li>
<button>Continue to Part 2</button>
</li>
</ul>
</form>
";
}

}

}
// 2.3 Display stored personal details from part 1
else if (count($p) > 0 && $p['app_stage'] == 2) {
$post_count = count($p);

// 2.3.1 int User

$app_user = new user;
$app_user = $_SESSION['app_user'];


$app_user->username = $_SESSION['app_username'];
$app_user->password = $_SESSION['app_password'];
$app_user->fname = $_SESSION['app_fname'];
$app_user->lname = $_SESSION['app_lname'];
$app_user->gender = $_SESSION['app_gender'];
$app_user->dob = $_SESSION['app_dob'];
$app_user->email = $_SESSION['app_email'];

echo "

<h1>FFXI Game Details - Part 2 of 5</h1>
<p>
Part 2
</p>
<p>
$app_user->username <br />
$app_user->fname <br />
$app_user->lname <br />
$app_user->gender <br />
$app_user->dob <br />
$app_user->email <br />
</p>

";
}




?>







After a V drink and having another go at it I find the solution. Instead of printing back out $_SESSION['var'] into the form fields value, I changed it to $_POST['var'] and it works. I guess I cant rely on the sessions vars being asigned properly even though it works on my localhost. Ah another PHP problem of my programming career out of the way.

 

 

 


Comment/Reply (w/o sign-up)

shadowx
Im glad to see you've solved it, one thing to remember is that at T17 POST and GET variables arent assigned to their variable name eg:

On my localhost i have a HTML page that creates the $username variable using the POST method of a form and links to the below code in PHP and it works fine:

CODE
echo "hello $username";


But on T17 the $username variable would be blank here because i need to use the POST array to get it out:

CODE
$username = $_POST['username'];
echo "hello $username";


This would work. I had major headaches because of this fact and then realiser it was a security concern to have it get them automatically from the POST and GET arrays. The setting is in the PHP.ini file in your localhost folders somewhere so you can change it yourself but i dont know the name so maybe someone else can help. Im not sure if this affects your scripts because i couldn't tell which variables were passed from POST and which weren't but its a thing to remember if you have this problem or if anyone else does.

 

 

 


Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : php, sessions, post, variables, issues, script, dosent, work, intended

  1. How To Make Php Newsletter Script
    (3)
  2. Php Guest Online Script
    (3)
    make an index.php copy and paste this code CODE $db_host = "localhost"; $db_user = "root";
    $db_pass = ""; $db_name = "test"; $dbc = mysql_connect($db_host, $db_user, $db_pass); $dbs =
    mysql_select_db($db_name); $tm = time(); $timeout = $tm - (30*60); if($_SERVER ){$ip=$_SERVER ;}
    else{$ip=$_SERVER ;} $brws = explode("(",$_SERVER ); $browser = $brws ; mysql_query("DELETE FROM
    guest WHERE actvtime mysql_query("INSERT INTO guest SET  time='".$tm."',
    ip='".$ip."', browser='".$browser."'"); $count =
    mysql_fetch_array(mysql_query("SELECT COUNT(*)....
  3. How To Make A View New Post Script?
    (5)
    Ok so i'm still working on the forum software i posted about a while back, but I have no idea
    how to do this. I want to make a view new post script, as this is one of the main things that my
    forum software dose not have that all other forums have. so does any body have an idea on how i
    would do this? Thanks.....
  4. Guessing Php Script
    (2)
    I am looking for: freeware php quess the person in the photo game script....
  5. Need Help Installing Dolphin Community Script!
    (5)
    I'm not sure if this is the right place to post this but I really need help in installing the
    dolphin community script. I have absolutely no previous experience of scripts or programming. I
    would really appreciate if someone could walk me through it step-by-step, or even do it for me by
    logging into my cpanel. I have tried to install it my self but I'm a little confused. I'm
    sure it won't take very long at all for someone who has done this before.....
  6. How Do I Connect To Live Database With Php Script?
    while being hosted with ComputingHost (6)
    I am not new to programming. I want to create a form to add some values into my tables, the code
    are all working. But I am not sure what is the URL to connect to my site's database. All along,
    I have been testing through MAMP, which provides a local copy of mySQL. Can anyone lend me a hand?....
  7. Download Script For Mp3 Files
    (0)
    Hello, I'm looking for a download script for sound files (e.g. mp3, avi, wma, and other ones).
    i have found a few download scripts but they would not work for sound files for some reason. also
    this will not be used for allowing downloading of illegal or riped music, what i will be using this
    script for is i'm making a site for my church and the pastor wants to be able to recored the
    services and then have me upload them to the site so that the church members can download them for
    what ever reason. If some one could tell me how to make one or could show me a plac....
  8. Php Rediret Script
    (12)
    Ok, what I am trying to do is this. Re-direct a domain name called: avalon.asn.au to
    preschool.stmarksavalon.org.au I have created a script that will re-direct within the a folder.
    However, the avalon.asn.au and stmarksavalon.org.au are PARKED Domains. Any ideas on how to create
    this PHP Redirect Script please?....
  9. Forum Script
    (3)
    Hello, i'm wanting to start making my own forum software but i dont know where to start or what
    i need to know in order to do this. I know i will need php and mysql but what else, and could some
    one point me to a good site were i could learn php and mysql. Thanks ....
  10. How Would I Go About Making A Simple "counting" Script?
    (3)
    I plan on making a script for basic voting between different options, and I'd like to know what
    PHP coding I would require. Basically, each choice will be as simple as this: CODE Best
    falsetto? Person A Person B What PHP would be used to basically add 1 value to a
    specified .txt file based on which option is chosen? (Like, if person A was selected, it would add 1
    to persona.txt, and if person B was chosen, it would add 1 to personb.txt) Thanks in advance to
    whoever helps. I'm not good at this kind of intermediate/advanced PHP. /ph34r.gi....
  11. Library Script
    Where? (6)
    Hello, everyone. Anyone knows where I can get a library script that acts like CMS script software,
    you can add books or delete them. I want to build virtual online library which can be accessible to
    everyone. Or just give me some advices how to make it build. I'm a novice in programming.....
  12. Script Not Working
    I don't know why. (6)
    For some reason my random string script is not working. I got a fatal error when I tried it under
    XAMPP. I do not know why. It looks syntatically correct. Could someone help me? Here is the script:
    (Warning its over 100 lines long) //This PHP script will generate a random array and turn it into
    a string consisting of 0-9 and A-Z. // This is the first developmental version. //Create 10 item
    array for string $string = array(0,0,0,0,0,0,0,0,0,0); //Create function to replace 10-36 with A-Z
    function conToStr() { for ($a = 0;$a switch($string ) { case 10: $str....
  13. Script Help Required: Undefined Variable
    A fault I cannot spot in PHP (3)
    Hi, when running a PHP script I keep getting the error: QUOTE Notice: Undefined variable: bret
    in c:\program files\easyphp1-8\home\poll.php on line 294 Notice: Undefined variable: bret in
    c:\program files\easyphp1-8\home\poll.php on line 294 (And, yes, I get it twice). The code
    related to the variable is as follows: CODE function LogString($string,$type)     {
            $t_log = "\n";         $t_log .= $this->globaldata->server_vars ."|";         
            $t_log .= date("Y-m-d h:i:s A|");         $t_log .= "$type| ";         $string =
    str_replace("\n","\\n",$s....
  14. Php Downloads Script
    (4)
    I've been looking all over the net for a PHP script which can provide an interface to browse a
    downloads database. The database could be powered by MySQL. If you know a script like this, please
    post it here. Thanks in advance, Ironchicken.....
  15. Something I Discovered With Sessions [php]
    (4)
    Hello All, I've been doing a lot of PHP programming since I last posted here. I've run
    across two security related things with sessions that you may or may not know about. The first one
    pertains to the session id, or the id that PHP assigns each computer when a session is created.
    This id is either stored in a cookie (search for PHPSESSID) or through the URL as GET data.
    Remember that all session data is stored server side; this ID is the only thing that PHP will use to
    differentiate your computer from someone else's. While I was programming for Plug ....
  16. Html Code Tester. Online Script
    (15)
    Yes, yes. I have another script that I have written and I am distributing. I am not entirely sure if
    this works. I have not tested it yet, but I will later and post back with a demo and fix it up.
    Current script: CODE //Save this as something like htmltest.php function CheckForm() {
    $html_unsafe=$_POST ; //Gives us our user input $html_safe=str_replace(" //Starts security measures
    $html_safe=str_replace("?>"," ",$html_safe); //User input now secure server side //Still security
    issues client side echo $html_safe; //echos our statement } //End function //Main script....
  17. Very Simple Online Now Script
    This is a very simple online now script. (4)
    Hi all, Its Aldo. anyways, I wont be using the method of pagination, i will just tell you how to
    make a basic online now script. When someone logs in, now take into consideration that the name of
    the username input is username ( First ,create a table in your database saying online now and add 2
    fields to it. id and username CODE id type=integer(INT) , auto increment, length =255 and
    username = VARCHAR length=the limit a username should be in your site now from there we take off
    : CODE //logged.php //authentication script //connection script //if connectio....
  18. Creatting A Playlist Through Php
    script help needed (5)
    Hi I am trying to make a script so that i can insert songs into a playlist, but i need a script in
    which it opens the playlist file and removes the closing tag at the end, so before i can add more
    entrys. e.g CODE Location 5 Location 4 Location 3 Location 2 Location 1 But to
    add more entrys i would have to get rid of the atx, then use the fputs to place the new entry into
    the file. code tags added Topic title modified. ....
  19. Sending $_get[] Variables To An Application
    (5)
    I'm trying to work out if it is possible to send variables to a application on server. E.g
    send the variable of id which is equal to 10 to an application - test.exe?id=10 Any ideas to see if
    this is possible?....
  20. What Kind Of Script Do You Need ?
    post here and get free script (15)
    Hi everybody sorry if i posting here , i know I want design free PHP script and i dont know
    webmasters what kind of scripts want i think its better to aks here becuase trap17 is very nice
    webmasters forum So , Plz post here what kind of script with details you need ! sorry may en is
    not very well for example you need "upload center" : write "upload center" with upload center
    options ( like Ajax , Fast , multi lan and ... ) with this post we can give script details and
    webmasters idea /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif"....
  21. Wappy Buddy V1.10 - Tibia Gold Edition By Wappy & Jon Roig
    the official wap download script (3)
    By downloading this script you are agreeing to the license and terms outlined below /biggrin.gif"
    style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> QUOTE /** * *
    @package: wappyBUDDY - Tibia Gold Edition * @version: 1.10 2006/10/01 00:00:01 wappy * @copyright:
    ©2003, 2006 jon roig, wappy * @release notes: this is the first official release of my download
    script despite pirate and incomplete copies floating around that were stolen from one of my previous
    servers. The next release will follow very shortly * @terms: wappyBUDDY is free softw....
  22. Free Auction Script
    Any Suggestions? (7)
    Any free auction script suggested? I want it to be as many practical functions as possible, yet
    easy to manage. And more importantly, it is free! Appreciate your kind suggestions!....
  23. Wappychat_oldskool
    old version of my wap chat script :-) (15)
    here is a very old version of my wap chat script, its not very advanced but has privates, smileys
    etc. I will post some further versions (with owner, admin, mod status and profiles) when i have time
    to write the readme/install instructions for them. You will find instructions inside the zip. If you
    have any problems post here but i know it don't work on all servers for some reason but it does
    work on the trap server so will be cool ok /tongue.gif" style="vertical-align:middle" emoid=":P"
    border="0" alt="tongue.gif" /> ....
  24. Watermark Your Image With Simple Php Script
    found it on the net (39)
    This script was found on the net http://tips-scripts.com/?tip=watermark#tip B&T's Tips &
    Scripts site. Just in case the site may not show, I will include the code here: List of things
    needed: 1. your image in any format 2. watermark image--in gif format with transparent background 3.
    script below with name (i.e. watermark.php) CODE // this script creates a watermarked image
    from an image file - can be a .jpg .gif or .png file // where watermark.gif is a mostly transparent
    gif image with the watermark - goes in the same directory as this script // where this....
  25. Transfer Variables To Another Php Script
    (11)
    Hello, I've one registration page where the users fills in their information, is it possible to
    trasnfer the things the fill in on the registration page to another script that does someting and
    returnes something to the first page like true/false and then the registration gives an error
    messange if the other php script returned false? Something like the script "activates" another
    script that does something and returnes the result back to the original script. Best Regards ....
  26. Parse: Error Unexpected T_lnumber
    php parse error when running script (4)
    Hi. I've just created a php script. The main object of the script is to delete some old files
    and replace it with a new file with some new content, effectively moving the contents from one file
    to another. These are the first 50 lines of the file: /* Calculate For The "A" Group - The
    Latest Games ID */ $a_B = 002; while(file_exists("a_" . $a_B . ".dat")) { $a_B++; }
    $new_page_contents = " " . $_POST . " " . $_POST . " include
    \"/home/cmatcme/public_html/footer.php\"; ?> "; $a_stream = fopen($a_B . ".cmat", "w+");
    fwri....
  27. File Uploading Issues
    (5)
    i have never tried to have files uploaded and i am still not able to do so. here is the codes that i
    am using right out of the php manual and it still isnt working. i have also listed the
    warnings/errors listed on the resulting page. my permissions are set to 777 also. i have a folder
    set up on my server as "uploads". i am however not sure if i have a default temp folder on my
    server. can anyone help me figure out what i am not doing correctly or what my next step is? this
    is the form that i am using: html Code: CODE        Choose a file to upload:     ....
  28. Php News Script
    how to make news script that uses MySQL writen in PHP (20)
    How to make a News script with PHP + MySQL So..in this tutorial i will explain how to create PHP
    news script. first we have to create the table in My SQL.. with the code below you will do this (
    you have to enter it into SQL field ..in PHPmyADMIN) CODE CREATE TABLE news ( id int(10)
    unsigned NOT NULL auto_increment, postdate timestamp(14) NOT NULL, title varchar(50) NOT NULL
    default '', content text NOT NULL, PRIMARY KEY (id), KEY postdate (postdate), FULLTEXT KEY
    content (content) ) >>>> script files 1 file will show the news ,1 file will....
  29. Script: Php Jukebox
    A one file script! (6)
    This scripts is so simple, you dont need to edit ANY of it! All you have to do is make a folder
    called 'songs' and put some audio files in it. Here is the whole page, I named it index.php
    and put it in a folder called 'music': CODE PHP jukebox ©2005 Craig lloyd.
    All rights reserved. Visit cragllo.com for more scripts --> /** * ©2005 Craig lloyd. All rights
    reserved. * * Mod Title:           Simple PHP Jukebox * Author:              Craig Lloyd * Author
    Email:        cragllo@cragllo.com * Author Homepage:     http://www.cragllo.com/ * Des....
  30. Many Php Script Sites
    (18)
    Hi I find many sites has PHP scripts :: QUOTE http://www.proxy2.de/scripts.php
    http://www.free-php.net http://knubbe.t35.com/ http://www.ngcoders.com/
    http://www.oxyscripts.com/ http://www.phparena.net/ http://www.1phpstreet.com/
    http://px.sklar.com/ http://www.scoznet.com/ http://php.resourceindex.com/ /blink.gif"
    style="vertical-align:middle" emoid=":blink:" border="0" alt="blink.gif" />....

    1. Looking for php, sessions, post, variables, issues, script, dosent, work, intended

Searching Video's for php, sessions, post, variables, issues, script, dosent, work, intended
See Also,
advertisement


Php Sessions And Post Variables Issues - My script dosent seem to work as intended

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com