Jump to content

MSUK1

Members
  • Posts

    188
  • Joined

  • Last visited

Everything posted by MSUK1

  1. okayyy so going back to my old method now.. i use this to get the id: <?php $id = NULL; if(isset($_GET['id']) && $_GET['id'] == "marc"){ $id = 'Marc.php'; } else if(isset($_GET['id']) && $_GET['id'] == "glenn"){ $id = 'Glen.php'; } else if(isset($_GET['id']) && $_GET['id'] == "nathan"){ $id = 'Nathan.php'; } else if(isset($_GET['id']) && $_GET['id'] == "scott"){ $id = 'Scott.php'; } ?> then use... $content = file_get_contents($filename); then! <?php echo $content ?>
  2. not using a database because its only 4 members whose data isnt going to change, could use one however good suggestion! and, no its just html markup for p and h1 tags
  3. oh such great feedback thankyou, okay sorry for the unclearness.. this is for a biography page, so their are only 4 bio's needed. when the user clicks a picture of a member, it loads their information (which will be in say marc.php) and that i thought would be easyier to write, than writing the individual bio's in the main page.
  4. ob_start(); include('file.php'); $content = ob_get_clean(); ok so this is the code i found for adding a file to a variable.. now how would i use it in term of this: <?php $id = NULL; if(isset($_GET['id']) && $_GET['id'] == "1"){ $id = 'Marc'; } else if(isset($_GET['id']) && $_GET['id'] == "2"){ $id = 'Glenn'; } else if(isset($_GET['id']) && $_GET['id'] == "3"){ $id = 'Nathan'; } else if(isset($_GET['id']) && $_GET['id'] == "4"){ $id = 'Scott'; } ?> ok so the get variable checks to see whose id youve requested. then when for example id = 4 i want to display an include file somewhere else on the page so i would use.. <?php echo $id; ?> now insted of it being "nathan" i want it to be a file i didnt really understand the first code i found
  5. http://www.largemusicevents.com/New2/index.php one of the menu images doesnt load the "what we do" image
  6. just solved this, please close i had a error in my database
  7. oh too add, my copy of the registration process can be seen here: http://www.msukgroup.co/ClientArea/system/register.php now if your just try to submit the form it will send back ALL errors, so i know that the data is making it past all stages BUT the database.php part
  8. hello, if any of you have heard of jpmaster777's login system, im using that reference: http://evolt.org/node/60384 ive added other variables before, but this time when ive tried to add another 6 variables i keep getting registration failed, wonder if anyone could take a brief look at the code and suggest the correct way to add another variable.. here is how i do it: register.php: add required fields <tr><td>Company:</td><td><input type="text" name="company" maxlength="30" value="<? echo $form->value("company"); ?>"></td><td><? echo $form->error("company"); ?></td></tr> <tr><td>First Name:</td><td><input type="text" name="firstname" maxlength="30" value="<? echo $form->value("firstname"); ?>"></td><td><? echo $form->error("firstname"); ?></td></tr> <tr><td>Last Name:</td><td><input type="text" name="lastname" maxlength="50" value="<? echo $form->value("lastname"); ?>"></td><td><? echo $form->error("lastname"); ?></td></tr> <tr><td>Email:</td><td><input type="text" name="email" maxlength="50" value="<? echo $form->value("email"); ?>"></td><td><? echo $form->error("email"); ?></td></tr> <tr><td>Tel:</td><td><input type="text" name="tel" maxlength="50" value="<? echo $form->value("tel"); ?>"></td><td><? echo $form->error("tel"); ?></td></tr> <tr><td>Address:</td><td><input type="text" name="address" maxlength="50" value="<? echo $form->value("address"); ?>"></td><td><? echo $form->error("address"); ?></td></tr> <tr><td>Website:</td><td><input type="text" name="website" maxlength="50" value="<? echo $form->value("website"); ?>"></td><td><? echo $form->error("website"); ?></td></tr> <tr><td>Username:</td><td><input type="text" name="user" maxlength="50" value="<? echo $form->value("user"); ?>"></td><td><? echo $form->error("user"); ?></td></tr> <tr><td>Password:</td><td><input type="password" name="pass" maxlength="50" value="<? echo $form->value("pass"); ?>"></td><td><? echo $form->error("pass"); ?></td></tr> session.php: add the variables /** * register - Gets called when the user has just submitted the * registration form. Determines if there were any errors with * the entry fields, if so, it records the errors and returns * 1. If no errors were found, it registers the new user and * returns 0. Returns 2 if registration failed. */ function register($subcompany, $subfirstname, $sublastname, $subemail, $subtel, $subaddress, $subwebsite, $subuser, $subpass){ global $database, $form, $mailer; //The database, form and mailer object /* company error checking */ $field = "company"; //Use field name for number if(!$subcompany || strlen($subcompany = trim($subcompany)) == 0){ $form->setError($field, "* Company not entered"); } /* firstname error checking */ $field = "firstname"; //Use field name for number if(!$subfirstname || strlen($subfirstname = trim($subfirstname)) == 0){ $form->setError($field, "* First name not entered"); } /* lastname error checking */ $field = "lastname"; //Use field name for number if(!$sublastname || strlen($sublastname = trim($sublastname)) == 0){ $form->setError($field, "* Last name not entered"); } /* tel error checking */ $field = "tel"; //Use field name for number if(!$subtel || strlen($subtel = trim($subtel)) == 0){ $form->setError($field, "* Number not entered"); } /* address error checking */ $field = "address"; //Use field name for number if(!$subaddress || strlen($subaddress = trim($subaddress)) == 0){ $form->setError($field, "* Address not entered"); } /* website error checking */ $field = "website"; //Use field name for number if(!$subwebsite || strlen($subwebsite = trim($subwebsite)) == 0){ $form->setError($field, "* Website not entered"); } /* Username error checking */ $field = "user"; //Use field name for username if(!$subuser || strlen($subuser = trim($subuser)) == 0){ $form->setError($field, "* Username not entered"); } else{ /* Spruce up username, check length */ $subuser = stripslashes($subuser); if(strlen($subuser) < 5){ $form->setError($field, "* Username below 5 characters"); } else if(strlen($subuser) > 30){ $form->setError($field, "* Username above 30 characters"); } /* Check if username is not alphanumeric */ else if(!eregi("^([0-9a-z])+$", $subuser)){ $form->setError($field, "* Username not alphanumeric"); } /* Check if username is reserved */ else if(strcasecmp($subuser, GUEST_NAME) == 0){ $form->setError($field, "* Username reserved word"); } /* Check if username is already in use */ else if($database->usernameTaken($subuser)){ $form->setError($field, "* Username already in use"); } /* Check if username is banned */ else if($database->usernameBanned($subuser)){ $form->setError($field, "* Username banned"); } } /* Password error checking */ $field = "pass"; //Use field name for password if(!$subpass){ $form->setError($field, "* Password not entered"); } else{ /* Spruce up password and check length*/ $subpass = stripslashes($subpass); if(strlen($subpass) < 4){ $form->setError($field, "* Password too short"); } /* Check if password is not alphanumeric */ else if(!eregi("^([0-9a-z])+$", ($subpass = trim($subpass)))){ $form->setError($field, "* Password not alphanumeric"); } /** * Note: I trimmed the password only after I checked the length * because if you fill the password field up with spaces * it looks like a lot more characters than 4, so it looks * kind of stupid to report "password too short". */ } /* Email error checking */ $field = "email"; //Use field name for email if(!$subemail || strlen($subemail = trim($subemail)) == 0){ $form->setError($field, "* Email not entered"); } else{ /* Check if valid email address */ $regex = "^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*" ."@[a-z0-9-]+(\.[a-z0-9-]{1,})*" ."\.([a-z]{2,}){1}$"; if(!eregi($regex,$subemail)){ $form->setError($field, "* Email invalid"); } $subemail = stripslashes($subemail); } /* Errors exist, have user correct them */ if($form->num_errors > 0){ return 1; //Errors with form } /* No errors, add the new account to the */ else{ if($database->addNewUser($subcompany, $subfirstname, $sublastname, $subemail, $subtel, $subaddress, $subwebsite, $subuser, md5($subpass))){ if(EMAIL_WELCOME){ $mailer->sendWelcome($subcompany,$subfirstname,$sublastname,$subemail,$subtel,$subaddress,$subwebsite,$subuser,$subpass); } return 0; //New user added succesfully }else{ return 2; //Registration attempt failed } } } process.php: add the fields to get the data from /* Registration attempt */ $retval = $session->register($_POST['company'], $_POST['firstname'], $_POST['lastname'], $_POST['email'], $_POST['tel'], $_POST['address'], $_POST['website'], $_POST['user'], $_POST['pass']); database.php: add my variables /** * addNewUser - Inserts the given (username, password, email) * info into the database. Appropriate user level is set. * Returns true on success, false otherwise. */ function addNewUser($company, $firstname, $lastname, $email, $tel, $address, $website, $username, $password){ $time = time(); $ip = $_SERVER['REMOTE_ADDR']; /* If admin sign up, give admin user level */ if(strcasecmp($username, ADMIN_NAME) == 0){ $ulevel = ADMIN_LEVEL; }else{ $ulevel = USER_LEVEL; } $q = "INSERT INTO ".TBL_USERS." VALUES ('0', '$company', '$firstname', '$lastname', '$email', '$tel', '$address', '$website', '$username', '$password', $ulevel, '$time', '$ip')"; return mysql_query($q, $this->connection); } and in constants.php ive edited the database config to suit: define("DB_SERVER", "localhost"); define("DB_USER", "msuk_support"); define("DB_PASS", "---------"); define("DB_NAME", "msuk_clients"); /** * Database Table Constants - these constants * hold the names of all the database tables used * in the script. */ define("TBL_USERS", "client_details"); define("TBL_ACTIVE_USERS", "active_users"); define("TBL_ACTIVE_GUESTS", "active_guests"); define("TBL_BANNED_USERS", "banned_users"); i know this is a biggy! but all help would be apppreciated
  9. so <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([a-zA-Z0-9_\.-]+)$ ClientArea/profile.php?username=$1 </IfModule> would ONLY rewrite request that look like "www.domain.com/ClientArea/BP" not, "www.domain.com/BP" that would get ignored?
  10. Sends message to were? You have notifications correct me if I'm wrong they are your internal messages, and you don't want to use emails as an external message (internal as in on your site an outside your site)
  11. Ok so best to create a notification system as mentioned above, use databases to store the notification and you could add a New part to your current code "one new message" and wen they read it it marks a read, in database 0s and 1s would do that
  12. use the php mail() function to send the message, and use a SQL query to select the email addresses of the users so.. $sql="SELECT email FROM $tbl_name;"; then set the sql query as a variable $emails, and execute the mail funciton sorry its not ellaborate, laptops bat 6% wantd to atleast explain this
  13. but the .hta... will automatically create the impression that /johnsmith exists but then profile.php will say "no johnsmith found" for example? and the 404 error? everything request that doesnt match a folder / file will be treaten as a username?
  14. this will complete erase the 404 error? is their a way to get this to check against a DB of usernames?
  15. this is a great post, question ontop, dont see the need for a new thread, what if in your site you have the neccessary directories /Contact /About etc... is this going to rewrite them to profile.php?user=contact etc etc? or will current directories and future addon directories remain directores
  16. please post it in the php brackets next time <?php $dbConnect = mysql_pconnect("localhost", "root") or die("Cannot connect database"); mysql_select_db("ABC") or die("Cannot select database"); $user = $_GET['uname']; $passwd = $_GET['passwd']; if (isset($_GET['submit'])) { $query = "select `fname`, `password` FROM details WHERE `fname`='$user' AND `password`='$passwd'"; $result=mysql_query($query); if(mysql_num_rows($result) == 1) { header('Location:C:\xampp\htdocs\ABCcinemas\index1.html\'); } else { echo "No match found !<hr />"; } } ?> what exactly is happening when this code is executed nothing?
  17. ok so started to use HTML emails, how can i now add php variables into that email ive tried this not working? done some research on google firsts too, tried another metod of using " . $var . " but no luck? $message = ' <!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>MSUKGroup</title> </head> <body> <table style="width: 100%" cellspacing="0" cellpadding="0"> <!-- MSTableType="layout" --> <tr> <td valign="top"> <table style="width: 500px" cellspacing="0" cellpadding="0"> <!-- MSTableType="layout" --> <tr> <td valign="top"> <img src="http://www.msukgroup.co/img/logos/orange.png" width="323" height="42" /></td> </tr> <tr> <td valign="top" style="margin-top:2px" class="maincontent"> <p>Dear {$name} ,</p> <p> </p> <p>Thankyou for contacting us via our online form, we have collected the following from your query:</p> <ul> <li>name:<br />{$name} </li> <li>email:<br />$email} </li> <li>website:<br />$web} </li> <li>tel:<br />{$tel} </li> <li>subject:<br />{$sub} </li> <li>message:<br />{$message} </li> </ul> <p>If their is anything else we can assist you with please call us, our number can be found on our website at <a href="http://www.msukgroup.co"> <span class="footer2"> http://www.msukgroup.co</span></a> </p> <p> </p> <p> </p> </td> </tr> <tr> <td class="footer1" valign="top"> </td> </tr> </table> </td> </tr> </table> </body> </html> ';
  18. in my php mail i use this code: $success = mail($EmailFrom, $Subject, $Body2, "From: <$EmailTo>"); and here are the variables for emial from and email to, $EmailFrom = Trim(stripslashes($_POST['email'])); $EmailTo = "info@mydomain.co"; when the email is received the sender just appears as info@mydomain.co how can i have it say MSUKGroup Auto Responder or something? instead of just repeat the address?
  19. Thanks a lot guys, always used tables so I guess I turn to divs now? Can anyone hint on hownibwould create such a complex layout (bet it's not even complex) in CSS?
  20. I thought that so with the images I made sure used "alt" text and named the images using HTML so that google picks up that relevant information still I submitted a sitemap and it indexed all pages, it's really weird, social networks Facebook I have 200000 people looking at this link and twitter has just starte up Yahoo it's ranked 1 and has lots of inlinks
  21. no worries cant beleive i never noticed it, thankyou
  22. <?php $message = NULL; if(isset($_GET['send']) && $_GET['send'] == "Y"){ $message = '- Thankyou, we will reply within 24 Hours'; } else if(sset($_GET['send']) && $_GET['send'] == "N"){ $message = '- Sorry, an error occured please try again'; } ?> and then where i need the message displayed: <fieldset><legend>Online Form <?php echo $message; ?></legend>
×
×
  • 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.