Jump to content

pro_se

Members
  • Posts

    131
  • Joined

  • Last visited

Everything posted by pro_se

  1. Ok, apparently I am an idiot.. I set the primary key to UID so it would not insert more than one with the same value..
  2. You would not need PHP to merely display pictures. As for the sound you could use JavaScript. A table in HTML with JavaScript should suffice.
  3. Wow, I don`t know what I would do without all of you, you all have helped me so much... Anyways, I have another problem that I am sure you all can figure out... I am currently attempting to insert user tags into a table on my database, I am using an WHILE statement to do this but PHP is acting fishy and its only inserting one of my array elements... Here is my code: function initialsetup($gender, $byear, $bmonth, $bday, $orientation, $tags, $uid) { if (($byear<1900)OR($byear>2100)) { header("Location: http://notexting.com/initial_setup"); } elseif (($bmonth<=0)OR($bmonth>12)) { header("Location: http://notexting.com/initial_setup"); } elseif (($bday<=0)OR($bday>31)) { header("Location: http://notexting.com/initial_setup"); } else { $eachtag = explode(", ", $tags); $repeat = 0; while (count($eachtag) > $repeat) { $uid = $_SESSION['userid']; $query = "INSERT INTO `tags` ( `uid` , `tag` ) VALUES ('$uid', '$eachtag[$repeat]')"; $insert_tags = mysql_query($query); $repeat++; } } } Please help! I am putting like 30 tags into the form and only one tag is being inserted into the DB!!!
  4. THANKS! YOU`RE ALL WONDERFUL!
  5. Hello, I am working on a project and I am stuck... I am looking for a way to validate email addresses when someone registers for my website, this is what I have so far and its not working... //register user function function registeruser($fname, $lname, $uname, $pword, $cpword, $email) { $fname = ucfirst($fname); $lname = ucfirst($lname); $sql_user_check = "SELECT * FROM user WHERE username='$uname'"; $result_name_check = mysql_query($sql_user_check); $usersfound = mysql_num_rows($result_name_check); $pword = md5($pword); $cpword = md5($cpword); if ($_SESSION['logged_in'] == 'yes') { header("Location: http://notexting.com/error"); } //check if username exists\\ elseif ($usersfound > 1) { header("Location: http://notexting.com/error/username"); } //check if passwords match\\ elseif ($cpword !== $pword) { header("Location: http://notexting.com/error/password"); } //check if email is vaild\\ elseif (checkemail($email)) { header("Location: http://notexting.com/error/email"); } else { $result=MYSQL_QUERY("INSERT INTO user (id,fname,lname,username,email,password)". "VALUES ('NULL', '$fname', '$lname', '$uname', '$email', '$pword')"); header("Location: http://notexting.com/register/success"); } } function checkemail($email) { if (!preg_match("/^( [a-zA-Z0-9] )+( [a-zA-Z0-9\._-] )*@( [a-zA-Z0-9_-] )+( [a-zA-Z0-9\._-] +)+$/" , $email)) { return false; } return true; } I think something in my if/else structure is wrong because if I enter wrong information in particular orders sometimes it responds different.. It would be greatly appreciated if someone could take a look at it and tell me what may be the problem..
  6. Ok, I messed with it a while more.. All I did was put the image at the bottom of the div.. <div class="right"><p class="boxed-content"><strong>Lorem ipsum dolor sit amet,</strong> consectetuer adipiscing elit. Nunc pulvinar nunc ac quam. Donec at diam. Donec aliquam posuere nisl. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Mauris libero eros, tempor sit amet, hendrerit a, dictum ut, pede. Maecenas consequat bibendum mauris. Aliquam id quam bibendum urna scelerisque interdum. In commodo lorem eu eros. Etiam ut sapien eget elit ullamcorper lobortis. Proin ipsum erat, elementum sed, tempus vel, sagittis sit amet, purus.</p> <img src="images/right-bottom.gif" width="517" height="50" border="0" /></div>
  7. http://cvnetworks.net/uploads/75.jpg
  8. pro_se

    Help with IE6

    Hiya! I recently began another project using Photoshop to slice a web design and I realized that when you slice things it creates tables that are not XHTML valid... I was quite disappointed and did some research trying to find a way around this. I ended up making all the tables into divs... I have one question though... [http://cvnetworks.net/uploads/75.jpg] Notice on the bottoms of the content panes there is that random thing... I don't know what that is... I have tried to remove it using all my prior knowledge but failed... I have also attached the code hoping one of you wonderful people have the time to take a look at it to maybe identify the problem... html-- <!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=iso-8859-1" /> <title>Untitled Document</title> <!--[if IE 6]> <style type="text/css"> .nav { padding-top: 20px; } </style> <![endif]--> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-image: url(images/bg.gif); background-repeat: repeat-x; font-family: Verdana, Arial, Helvetica, sans-serif; } .wrap { position: relative; width: 800px; margin-left: auto; margin-right: auto; } .header { position: relative; height: 153px; } .nav { position: relative; margin-top: -12px; margin-left: -20px; height: 32px; font-size: 20px; margin-left: auto; margin-right: auto; } .nav li { list-style: none; float: left; margin: 0px 40px; } .nav li a { color: #cc3333; } .nav li a:hover { color: #666666; } .mainsep { height: 38px; position: relative; background-image: url(images/topbox.gif); } .left { width: 282px; position: relative; background-image: url(images/left-main.gif); background-repeat: repeat-y; float: left; } .left-btm { position: relative; width: 282px; float: left; } .right { width: 518px; position: relative; background-image: url(images/right-main.gif); background-repeat: repeat-y; float: left; } .right-btm { position: relative; width: 518px; float: left; background-color: #FFFFFF; } .boxed-content { padding-left: 25px; padding-right: 19px; } .footer { position: relative; font-size: 10px; } --> </style></head> <body><div class="wrap"> <div class="header"><a href="#"><img src="images/header.gif" alt="NoTexting" width="799" height="153" border="0" /></a></div> <div class="nav"><ul> <li><a href="#">Home</a></li> <li><a href="#">Login</a></li> <li><a href="#">Register</a></li> <li><a href="#">Help</a></li> <li><a href="#">About</a></li> </ul></div> <div class="mainsep"></div> <div class="left"><p class="boxed-content">login area...</p> <div class="left-btm"><img src="images/left-bottom.gif" width="282" height="26" border="0" /></div> </div> <div class="right"><p class="boxed-content"><strong>Lorem ipsum dolor sit amet,</strong> consectetuer adipiscing elit. Nunc pulvinar nunc ac quam. Donec at diam. Donec aliquam posuere nisl. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Mauris libero eros, tempor sit amet, hendrerit a, dictum ut, pede. Maecenas consequat bibendum mauris. Aliquam id quam bibendum urna scelerisque interdum. In commodo lorem eu eros. Etiam ut sapien eget elit ullamcorper lobortis. Proin ipsum erat, elementum sed, tempus vel, sagittis sit amet, purus.</p> <div class="right-btm"><img src="images/right-bottom.gif" width="517" height="50" border="0" /></div> </div> <div class="footer" align="center">Footer Text goes here </div> </div> </body> </html>
  9. Hiya! I recently began another project using Photoshop to slice a web design and I realized that when you slice things it creates tables that are not XHTML valid... I was quite disappointed and did some research trying to find a way around this. I ended up making all the tables into divs... I have one question though... [http://cvnetworks.net/uploads/75.jpg] Notice on the bottoms of the content panes there is that random thing... I don't know what that is... I have tried to remove it using all my prior knowledge but failed... I have also attached the code hoping one of you wonderful people have the time to take a look at it to maybe identify the problem... html-- <!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=iso-8859-1" /> <title>Untitled Document</title> <!--[if IE 6]> <style type="text/css"> .nav { padding-top: 20px; } </style> <![endif]--> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-image: url(images/bg.gif); background-repeat: repeat-x; font-family: Verdana, Arial, Helvetica, sans-serif; } .wrap { position: relative; width: 800px; margin-left: auto; margin-right: auto; } .header { position: relative; height: 153px; } .nav { position: relative; margin-top: -12px; margin-left: -20px; height: 32px; font-size: 20px; margin-left: auto; margin-right: auto; } .nav li { list-style: none; float: left; margin: 0px 40px; } .nav li a { color: #cc3333; } .nav li a:hover { color: #666666; } .mainsep { height: 38px; position: relative; background-image: url(images/topbox.gif); } .left { width: 282px; position: relative; background-image: url(images/left-main.gif); background-repeat: repeat-y; float: left; } .left-btm { position: relative; width: 282px; float: left; } .right { width: 518px; position: relative; background-image: url(images/right-main.gif); background-repeat: repeat-y; float: left; } .right-btm { position: relative; width: 518px; float: left; background-color: #FFFFFF; } .boxed-content { padding-left: 25px; padding-right: 19px; } .footer { position: relative; font-size: 10px; } --> </style></head> <body><div class="wrap"> <div class="header"><a href="#"><img src="images/header.gif" alt="NoTexting" width="799" height="153" border="0" /></a></div> <div class="nav"><ul> <li><a href="#">Home</a></li> <li><a href="#">Login</a></li> <li><a href="#">Register</a></li> <li><a href="#">Help</a></li> <li><a href="#">About</a></li> </ul></div> <div class="mainsep"></div> <div class="left"><p class="boxed-content">login area...</p> <div class="left-btm"><img src="images/left-bottom.gif" width="282" height="26" border="0" /></div> </div> <div class="right"><p class="boxed-content"><strong>Lorem ipsum dolor sit amet,</strong> consectetuer adipiscing elit. Nunc pulvinar nunc ac quam. Donec at diam. Donec aliquam posuere nisl. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Mauris libero eros, tempor sit amet, hendrerit a, dictum ut, pede. Maecenas consequat bibendum mauris. Aliquam id quam bibendum urna scelerisque interdum. In commodo lorem eu eros. Etiam ut sapien eget elit ullamcorper lobortis. Proin ipsum erat, elementum sed, tempus vel, sagittis sit amet, purus.</p> <div class="right-btm"><img src="images/right-bottom.gif" width="517" height="50" border="0" /></div> </div> <div class="footer" align="center">Footer Text goes here </div> </div> </body> </html>
  10. hello, is there a function that could take all the text on a external page or url and save it to a flat text file or mysql table?
  11. [code]<?php $variable = ceil(2.4); //this is 2.4 echo "$variable"; //I want this to say 3 ?>[/code]
  12. whoops, just answered own question... ceil()
  13. say i had 2.4, how would i make it so it was 3? [code]<?php $variable = 2.4; //this is 2.4 echo "$variable"; //I want this to say 3 ?>[/code]
  14. k, so i have my previous and next links working (GREAT) but what i cannot figure out is how to put the individual pages (page 1, page2, page3) ex. [prev.] [page1] [page2] [next] k so i know i have to divide the number of rows by how many i am showing rows i am showing on the page to get the total of pages but how would i make it count 1, 2 to 3 here is the code i have for the prev. next pages: [code]<?php include '/home/*********/inc/config_db.php'; $sql125 = "SELECT * FROM `users`";   $rowstart = $_GET['pfg']; if(!$_GET['pfg']) $rowstart=0; $sql = "SELECT * FROM users order by username asc limit $rowstart,5";   $result = mysql_query ($sql, $connection); while($row=mysql_fetch_array($result)) {   $userid = $row["userid"];   $first_name = $row["first_name"];   $last_name = $row["last_name"];   $username = $row["username"];   $email_address = $row["email_address"];   $setting_email = $row["setting_email"];   $setting_files = $row["setting_files"];   $activated = $row["activated"];   echo "<div style=\"background: url(http://images.*********.net/browse_bg.gif); background-repeat: repeat-y; padding-left: 6px;\"><i>$first_name $last_name</i><br />$username<br />"; if ($setting_email == '1') { echo "<a href=mailto:$email_address>$email_address</a><br />"; } else { echo "* email hidden *<br>"; } if ($setting_files == '1') { echo "Files: (private)</div><br>"; } else { echo "Files: "; $sql2    = "SELECT * FROM image where userid=$userid"; $result2 = mysql_query ($sql2, $connection); $num = mysql_num_rows ($result2);   echo "$num"; echo " <a href=viewuser.php?userid=$userid>(view)</a></div><br>     "; } } //initialize the start to 0 //put all the code here for running the script itself using $result in the while loop //put where you want the next prev to appear $result125 = mysql_query ($sql, $connection);   $numrows = mysql_num_rows($result125); echo '<p>'; if($rowstart+5>$numrows) {   echo "<A HREF=\"$php_self?pfg=";$minus = $rowstart-5;echo "$minus\">< Previous Page</A> "; } if($rowstart-5<$numrows) {   echo "<A HREF=\"$php_self?pfg=";$plus = $rowstart+5;echo "$plus\">Next Page ></A>"; } echo '</p>'; ?>[/code]
  15. can someone tell me why this form is not updating the database... [code]  <p>   <?php   if(isset($_POST[Submit])) {     $post_email = $_POST['email'];   $youruserid = $_SESSION['userid'];   mysql_query("UPDATE users SET email_address=$post_email WHERE userid='$youruserid'");   }   ?> <form action="settings.php" method="post">     <label>eMail Address:     <input name="email" type="text" id="email" value="<?php echo "$email_address"; ?>" />   </label><br />   <label>Would you like your email address hidden?<br>   <input name="pub_email" type="checkbox" id="pub_email" <?php   $username = $_SESSION['username']; $sql78 = mysql_query("SELECT * FROM users WHERE username='$username'"); while($row78 = mysql_fetch_array($sql78)){ $pub_email_setting = $row78['setting_email']; }   if ($pub_email_setting == '0') { echo 'checked'; } ?> value="true" />   </label><br>   <label>   <input type="submit" name="Submit" value="Submit">   </label>   </p> </form> [/code]
  16. does anyone see a reason for this happening?
  17. nope, took out the register_session thingys. it still does the exact same thing...
  18. k, imma try that nd see what happens...
  19. yup, im way ahead of you but thats beside the point.. do you know why it would show that i am different users everytime that i refresh the page?
  20. kk, i tried to put it in the same <?php ?> thing and this is what i got... [quote]Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/.jumper/cvnetwor/cvnetworks.net/logout.php:6) in /home/.jumper/cvnetwor/cvnetworks.net/logout.php on line 21[/quote] apparently it needs to be the first thing...
  21. its there.. at the top.. ahah, dont worry im not that stupid.. or wait, is that supposed to be in the same <?php ?> thing?
  22. same problem as this guy.. [url=http://www.phpfreaks.com/forums/index.php/topic,6460.0.html]http://www.phpfreaks.com/forums/index.php/topic,6460.0.html[/url]
  23. ok, so i have this website where users can login -- yadda yadda.. ok, anyways.. i create the session varibles when the users are validated during login (as such)[code] session_register('userid');         $_SESSION['userid'] = $userid;         session_register('username');         $_SESSION['username'] = $username; session_register('logged_in123'); $_SESSION['logged_in123'] = 'true123';         session_register('first_name');         $_SESSION['first_name'] = $first_name;         session_register('last_name');         $_SESSION['last_name'] = $last_name;         session_register('email_address');         $_SESSION['email_address'] = $email_address;[/code] and i display the session varibles as such: [code]<?php $logged_in123 = $_SESSION['logged_in123']; if ($logged_in123 == 'true123') { include '/home/cvnetwor/inc/cvnetworks_settings_form.php'; } else { echo "<p><strong>You must be logged in to access this area...</strong></p>"; include '/home/cvnetwor/inc/cvnetworks_login_form.php'; } ?>[/code] ok, i keep getting this funny thing where it shows the other users usernames: [code]<?php $logged_in123 = $_SESSION['logged_in123']; $sessionstoredname = $_SESSION['username']; if ($logged_in123 == 'true123') { echo 'Welcome '.$sessionstoredname.'. (<a href="http://cvnetworks.net/logout.php">Logout</a>)'; } else { echo 'Welcome Guest. (<a href="http://cvnetworks.net/login.php">Login</a> | <a href="http://cvnetworks.net/register.php">Register</a>)'; } ?>[/code] there is one user called (cvarma and one called omgpants and my phpmyadmin username sudo keep getting switched up with these sessions) it displays all kinda funky names in the status thing right here ^ my question is why am i getting different usernames to show up in there?
  24. thanks, that got rid of the error but now its not showing what file is public and what file is private... i am using uploader v6.3 and that segment/ function of code is used to convert the integer into a string for example it would convert 1 to public.. how would that work with this particular function..??
×
×
  • 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.