Jump to content

richie_ropey

Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

richie_ropey's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. genericnumber1, thank you very much but I already got owned on IRC for being a noob on that subject :D. My first proper atempt at a user class. Hope this helps anyone in the future :)
  2. I'm having a problem with a couple of classes which dont seem to want to interact with each other, the way it works is: [b]users.php/user_control.php[/b] (contains various functions) ---- pass information to.... [b]page_control.php[/b] (controls which actions should be used where and decides weather to show them or not based on users status) ------ which in turn passes to..... index.php (which contains all display information and navigation, pics , etc...) im getting an error saying: [b]Fatal error: Call to a member function registrationForm() on a non-object in C:\Program Files\xampp\htdocs\wf\user_class\page_control.php on line 21.[/b] which implys that i have not declared the function in users.php (which is included in get_content.php). [b]page_control.php[/b] [code]<?php include('user_control.php'); include('users.php'); $registration = new registration; $user_control = new userControl; class pageControl { var $level; function getContent() { if (!isset($_GET['action'])) { if ($this->restrictedPage(4, true)==false) { ?><link rel="stylesheet" href="CSS/large_forms.css" /><?php $registration -> registrationForm(); } else { $this->restrictedPage(4, true); } }[/code] not pasting it all :P [b]users.php[/b] [code]<?php session_start(); class registration { var $error; var $error_msg_username; var $error_msg_password; var $error_msg_validate; var $error_msg_email; var $user_ID; var $username; var $password; var $password_check; var $email; var $date_registerd; var $occupation; var $location; var $active; var $stats_ID; var $axx_level; var $u_title; var $last_active_time; var $last_active_day; var $last_active_date; var $cookie_hash; var $last_known_IP; function process() { $this->validateForm(); if ($this->error == true) { $this->errorReport(); } else { $this->processForm($this->username, $this->password, $this->email, $this->date_registerd, $this->occupation, $this->location, $this->active); $this->processStats($this->user_ID, $this->axx_level, $this->u_title, $this->last_active_time, $this->last_active_day, $this->last_active_date, $this->cookie_hash, $this->last_known_IP); $this->conformationEmail($this->username, $this->active); } } function registrationForm() { ?> <div class="note">* denotes a required field</div> <form action="index.php?action=process" method="post"> <div class="formSection"> <div> <div class="formLabel">Username*:</div> <div class="formInput"> <?php if (!($_POST['username'])) { ?> <input type="text" name="username" /> <?php } else { ?> <input type="text" name="username" value="<?php echo $_POST['username'] ?>" /> <?php } ?> </div> </div> <div> <div class="formLabel">Password*:</div> <div class="formInput"><input type="password" name="password" /></div> </div> <div> <div class="formLabel">Password conformation*:</div> <div class="formInput"><input type="password" name="password_check" /></div> </div> <div> <div class="formLabel">Email*:</div> <div class="formInput"> <?php if (!($_POST['email'])) { ?> <input type="text" name="email" /> <?php } else { ?> <input type="text" name="email" value="<?php echo $_POST['email'] ?>" /> <?php } ?> </div> </div> <div> <div class="formLabel">Occupation:</div> <div class="formInput"> <?php if (!($_POST['occupation'])) { ?> <input type="text" name="occupation" /> <?php } else { ?> <input type="text" name="occupation" value="<?php echo $_POST['occupation'] ?>" /> <?php } ?> </div> </div> <div> <div class="formLabel">Location:</div> <div class="formInput"> <?php if (!($_POST['location'])) { ?> <input type="text" name="location" /> <?php } else { ?> <input type="text" name="location" value="<?php echo $_POST['location'] ?>" /> <?php } ?> </div> </div> </div> <div class="formSection"> <h5 style="font-weight:normal">Please enter the string shown in the image in the form.<br> The possible characters are letters from A to Z in lower case form and the numbers from 0 to 9. This is required to confirm your registration.</h5> <div class="formInput"><input name="number" type="text"><br /><img src="includes/random_image.php"></div> </div> <div class="formSection"> <input type="submit" name="button" value="Submit"> </div>   </form> <?php         }[/code] [u][i][b]registrationForm()[/b][/i][/u] <-------------------------------------- see look right there, its declared. please help before i start loosing my hair though stress, im only 19 and i like my hair  ;)
  3. hey guys and gals, im getting this error: Notice: Undefined variable: _SESSION in c:\program files\easyphp1-8\www\project\setup\users\untitled-1.php on line 22 untitled-1.php has this at line 22 [code] echo $_SESSION['user']; [/code] i have used the $_SESSION vaiable literaly hundereds of times on my localhost and in other pages in this project, so i really have no clue as to whats going on, please help because im not very far away from making a fist shaped hole in my laptop monitor EDIT: doh! i forgot session_start(), im such an idiot somtimes!
  4. hi, i have some code [code]         $j = 0;     if (isset($_SESSION['c_a_num_fields']))     {         for ($i=0; $i < $_SESSION['c_a_num_fields']; $i++)         {             if (isset($_SESSION['c_asset_value_'.$i.'']))             {                 $sort[$j] = $_SESSION['c_asset_value_'.$i.''];                 $j++;             }         }         for ($i=0; $i < $_SESSION['c_a_num_fields']; $i++)         {             $_SESSION['c_asset_value_'.$i.''] = $sort[$i];         }     } $j = 0; [/code] this idea of this code is to sort $_SESSION['c_asset_value_'.$i.''] so that $i goes: 1 2 3 4 5 instead of 1 3 4 5 8 (just an example), the reason for this happening is to do with deleting cirtain sessions, mainly cause i dont want to use the database for this sort of stuff. this code dosnt work (though i think the logic looks good :|), i was wondering if theres: a) anyway to fix the current code b) alternative code c) a session function to do this for me (ive looked in the php manual and saw somthing about session_regenerate_id, but i dont understand how it works) thanks - Rich
  5. Is there a way to select all the variables currently registerd in the $_SESSION variable?
×
×
  • 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.