Jump to content

Missing Argument / Header() Alternative Issues!


Jumpy09

Recommended Posts

This is taken off another website, it's a Log-In Script from JPMaster77, Log-In System 2.0 or something rather.

 

The $userid is a randomly generated session id which allows cookies to not store passwords.  It's rather ingenious, but it's not generating it to store into the database upon registration.  It's got me stumped.  If you need more code, let me know.  The script can be found:  Here

 

I figured I would probably get an answer and a fix quicker here than the forums on JP77's forums.

 

Alright so I started out with the original script and had to convert to the new script.  Basically, I just over wrote the entire file side, but forgot to upgrade the sql tables.

 

So I get the following Error:

 

Warning: Missing argument 4 for MySQLDB::addNewUser(), called in C:\AC Web Ultimate Repack\Server\htdocs\tryandfail\includes\login\session.php on line 321 and defined in C:\AC Web Ultimate Repack\Server\htdocs\tryandfail\includes\login\database.php on line 158

Warning: Missing argument 5 for MySQLDB::addNewUser(), called in C:\AC Web Ultimate Repack\Server\htdocs\tryandfail\includes\login\session.php on line 321 and defined in C:\AC Web Ultimate Repack\Server\htdocs\tryandfail\includes\login\database.php on line 158

Warning: Cannot modify header information - headers already sent by (output started at C:\AC Web Ultimate Repack\Server\htdocs\tryandfail\includes\login\database.php:158) in C:\AC Web Ultimate Repack\Server\htdocs\tryandfail\process.php on line 120

 

Line 158:    function addNewUser($username, $password, $email, $userid, $name){ 

Line 321:    if($database->addNewUser($subuser, md5($subpass), $subemail)){ 

 

Now the Table Design, should be the problem.  It's the only thing I can think of, so in order from 1st to .. not last.. but anything after them shouldn't count.

 

My Table: uid, username, password, userid, userlevel, email, timestamp, valid, name  .... dname, fname, lname, zipcode, country, gender, relstatus, bdaym, bdayd, bdayy, ....

 

Version 2.0 Table: username, password, userid, userlevel, email, timestamp, valid, name

 

So I was thinking, it was either the uid at the beginning of mine... But my registration worked right on Version 1, and it was identical.

 

So I altered this section:

      $q = "INSERT INTO ".TBL_USERS." VALUES ('','$username', '$password', '$userid', $ulevel, '$email', $time, '0')";

 

Still nothing remotely awesomeness.  It does on the other hand show errors now, and I removed the $name from everything I can find.  I don't really need it.

 

I'm fairly decent at plucking out errors, but this one is throwing me for a loop.  Anyone got suggestions?  I need my site available for Registration so I can begin Beta Testing on it.

 

 

 

So for my second Problem, I have this code.

 

<?php

/***	February 11, 2010: Date of Creation
	Functions - Currently for HTML / URL ***/

/********** Redirect Function: Should allow redirect with header information already sent **********/

function redirect($url) {
    global $db, $cache;
    if(is_object($cache)) $cache->resync();
    if(is_object($db)) $db->sql_close();
    $type = preg_match('/IIS|Microsoft|WebSTAR|Xitami/', $_SERVER['SERVER_SOFTWARE']) ? 'Refresh: 0; URL=' : 'Location: ';
$url = str_replace('&', "&", $url);
    header($type . $url);
    exit;
}

?>

 

In case people have a rough time with it, it allows for the ... """Warning: Cannot modify header information - headers already sent by (output started at C:\AC Web Ultimate Repack\Server\htdocs\tryandfail\includes\login\database.php:158) in C:\AC Web Ultimate Repack\Server\htdocs\tryandfail\process.php on line 120""" to work even if headers have been sent.

 

My problem is I have no fricken idea how to implement it to work.  I tried adding it in as a function, but ... I don't know.  Anyone got any idea?

 

As always, thanks in advance.  Hopefully someone snatches this up soon.  The header thing isn't a main concern, it only happens if someone f**ks something up...  like I have with the Registration page.  It would be nice though, instead of having to put in independent links back to something.

Just for clarification:  I know it has 4 variables when it only expects three.  I'm working with someone on another site to fix this issue, but it doesn't seem like he's going to be much help.

 

The bday m,d,y if for Birthdays.  I currently have no other way of using a drop down list to achieve the same purpose any other way.

 

For the header() thing.  I know why it happens, I'm trying to figure out how to use the function to prevent it from doing so.

 

 

If you need to see more of the code, let me know.  I've found all the sections it's talking about and other parts only have 3 variables, while the one which inserts it in the database has 4.  I do not know why it was coded this way, I'm just trying to fix it so I can use it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.