Jump to content

shakeit

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

shakeit's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yeah I would but there are so many places I get this error, hehe... anywayz I tried this solution by putting header an session_start() before anything else, and it works.. But what if I want to use header() in the middle of a html page :-S Thats the issue, but i get the idea... thanx...
  2. What do you mean before its outputted?
  3. No it doesnt make the "redirect" to the wanted page then ... the same with cookies, t wont save the information in the cookies...
  4. Hello, I am getting this error at several places: headers already sent (output started at ......) I think it is a common error, so sorry for asking such a "stupid" question... Does a common rule exist for avvioding these errors? Thank you all...
  5. Okey , so I can set all of the letter to lower case in the code AND change ereg to eregi and still use both small and big letters? Thanx man...
  6. Hmm.. no i do not want the underscore in the name, that was my bad, i didnt even notice that, heheh... I only want, small letters a to z, big letters A to Z and space. so is this right then: ^[a-z]+([ ][A-Z]+)?$
  7. Hello everybody, I have a little issue regarding chars and signs that are aprooved in a text string. I want to check the field $name to contain only small and big letters which is usual in a name. But it happens that some people have two names, e.g. one main and one middle name. So I want to allow the user to write both names in one text field, i.e. by using space between them, for example: Jon Thomas. How do I add the space character in the code below in $goodChars, if it is possible? Thanx very much in advance and I hope you understand the problem description :-) ---------------------------------------------------------------------------------- public function validateName($name) { $goodChars = "^[a-z_A-Z]+$"; if( ereg("$goodChars",$name) && strlen($name) > $nameLengthMIN ) { return true; } else { return false; //Only A-E and - } } ---------------------------------------------------------------------
  8. Okey, but is it wrong or not good to use the solution: echo "meta......" Like kingy above posted?
  9. yeah but i am using this header after I push a button .. that is in an if() - loop ....
  10. Hello everyone, i am trying to redirect to another page.... I have a line that says... header("Refresh: 5; url=install.php"); Is it another way to redirect to another file with a pause, i.e. that will do the same as the header line above? Thank you all in advance once again and hope someone out there can helo me :.))
  11. if you want to hide these notifications you can modify your config file and set the error reporting to a lower value....
  12. Thanx a lot :-) Ut worked ...
  13. Hello everybody... You've helped me out a couple of times and I am still comming back :-) I need some help on a ereg issue, where I want to make a function where ONLY digits are possible when writing something in a field... i.e. only 0,1,2,3,4,5,6,7,8,9,10,..... However, I thought the function below did that, but only to a certain point... if I write only letters then I will get false, which is ok.. but if I write digits first and then letters, 55aabb, then I get true... Do you see my problem? I only want it to allow digits, nothing else: public function validatePhone($validate) { $goodChars = "^[0-9]"; if( ereg("$goodChars",$validate) ) { // if there are less than 8 digits, then its not correct. if( strlen($validate) < 8 ) { return false; } else { return true; } } else { return false; } } PS! I also have the same problem when I only want to allow letters in another function .. So please help me, AGAIN :-) Thanx in advance
  14. Write an explicit file for the user information and include it in database config file... hmmm.. yeah, that might work, but it will make two files... but a good solution.. thanx... :-)
  15. Yeah but this config file is used further in the class to connect to database and so on, so it contains a lot of data in the config file which is loaded at every webpage, for instance: <?PHP //------ Paramaters to change ------// $server = "localhost"; //databasename $uname = "root"; //username $pw = "something"; //password $dbprefix = 'test'; //the prefix of the database and tables $database = $dbprefix.'community'; //-------- ------------- --------------// //tables that are used by the objects $users_table = $dbprefix."users"; $statistic_table = $dbprefix."statistics"; $administrators_table = $dbprefix."administrators"; $online_table = $dbprefix."online"; $vote_table = $dbprefix."vote"; $vote_statistic = $dbprefix."vote_statistics"; // Login / Logout features $incorrectLogin = 'Incorrect login'; //Incorrect login message $loginHeader = 'tull.php'; //Page to redirect after successfull login $logoutHeader = 'logout.php'; //Page to redirect after wanting to logout $frontpage = 'front.php'; //Redirect page after successfull logout //Script options $nameLengthMIN = 2; $adressLengthMIN = 5; $emailLengthMIN = 5; $phoneLengthMIN = 8; $cityLengthMIN = 2; $countryLengtMIN = 2; $usernameLengthMAX = 20; $passwordLength = 4; $sendMail = true; //errormessages $couldNotConnectMysql = "<BR>Error!<BR>Could not connect to MySQL.<BR>\n Please check your settings in config.php"; $couldNotOpenDB = "<BR>Error!<BR>Could not open database.<BR>\n Please check your settings in config.php"; $invalidDate = "<BR>Error!<BR> Invalid date format OR early year, must be YYYY-MM-DD"; $blankField = "<BR>Error!<BR>You must enter a date and at least two alternatives"; $noSelection = "<BR>Error!<BR>You must select one alternative"; //.......................... Connecting to database ............................................// $connect2 = mysql_connect($server,$uname,$pw); $query = "use $database"; if( mysql_query($query) == null ) { $query = "CREATE DATABASE $database"; $result = mysql_query($query); if( $result == 1 ) { $connect = mysql_connect($server,$uname,$pw) or die ($couldNotConnectMysql); mysql_select_db($database,$connect) or die ($couldNotOpenDB); } else { echo "Error in database (Errornumber ". mysql_errno() .": \"". mysql_error() ."\")<br>"; } } else { //it already exists, so we connect $connect = mysql_connect($server,$uname,$pw) or die ($couldNotConnectMysql); mysql_select_db($database,$connect) or die ($couldNotOpenDB); } ?> It would not be so good to write all of this? Isnt it a way just to replace the three first variables? Thanx...
×
×
  • 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.