Jump to content

RottenBananas

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Everything posted by RottenBananas

  1. Great Thanks! Any suggestions on the lightbox idea or any other particular advice?
  2. Hi everyone, My friend created her first website and any advice or suggestions would be greatly appreciated! Here it is: www.dreamerinme.com Tell me what you think.
  3. Hey there, Thanks a ton for taking the time to make such a thorough review! Couple questions, For the xhtml validation...how can I fix it? What does it affect if it is broken? I'll see if I can make the search box a bit bigger, thats a good idea. The <p> tags aren't supposed to be there, I thought i removed them, i'll fix that I will cut the ads down as well...thanks for the tip. This is my first time, i still dont know what a good baseline is for the number of ads. I see how the CPM works now after your explanation. I think i'll remove most of the google ads for now. Any tips for other ad sites (alternatives to adsense)? And what can I use to log where users are clicking? Thanks so much again!
  4. Hey everyone, well here it is... http://bhaviksblog.com Very open to changes, its about a month old...i'll be adding many more tutorials soon. Please leave as much feedback as you can! Thanks!
  5. Hey guys, Im making a website that has users and profiles. The users can join groups. One user can be in many groups. All of this works fine. What im not sure on is having a home page for each group. Every user has a homepage. I want every group to also have a homepage showing what users are in the group. I think i need to dynamically add a .php file every time a user creates a group? Is this the way to do it or is there a better idea? Thanks
  6. Should I post this in a different category?
  7. Thanks for the reply, I have all this code written already though does anyone know whats wrong with it? How can I do it using ajax? Could you give me some sample code? Im not understanding why my method isn't working Thanks again
  8. Thanks for the reply, The users will always have an account, Ok I dont know how to code at all and im kinda pullin all this outta nowhere and hoping it works...reading through random tutorials and such. If im approaching it the wrong way please tell me (I dont know any better) Here's what I tried... 2 Javascript fucntions function getpos() { var Top = document.getElementById('mydiv').offsetTop ; var Left = document.getElementById('mydiv').offsetLeft; return {Top:Top,Left:Left} } function init() { var pos = getpos(); document.myform.Top.value = pos.Top; document.myform.Left.value = pos.Left; } Then the html hidden fields in my form <form name="myform" action="savepos.php" method="post"> <input type="hidden" name="Top"> <input type="hidden" name="Left"> <input type="submit" name="submit" value="Save" onClick=init()> </form> And finally savepos.php which writes it to my db $Top = $_POST['Top']; $Left = $_POST['Left']; $sql = "SELECT profile_id FROM positions WHERE profile_id=".$_SESSION['uid'].";"; $res = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($res) == 0) { $sql2 = "INSERT into positions (profile_id,Top,Left) VALUES(".$_SESSION['uid'].",'$Top','$Left');"; $res2 = mysql_query($sql2) or die(mysql_error()); } else { $sql3 = "UPDATE positions SET Top='$Top',Left='$Left' WHERE profile_id=".$_SESSION['uid'].";"; $res3 = mysql_query($sql3) or die(mysql_error()); } echo "<script language=\"Javascript\" type=\"text/javascript\"> alert(\"Your profile layout has been updated\") document.location.href='home.php'</script>"; } This example only shows one divider that you can drag but you get the idea for adding more. The problem is that if the user doesnt drag it and leaves it as is it resets the positions to 0. For example I have 2 divs, mydiv and yourdiv...if the user moves mydiv to top=250; left=250; but doesnt touch yourdiv and clicks save...its sets yourdiv to top=0; left=0; Any suggestions? Am I approaching this the right way? Thanks alot
  9. Hey guys, For my site im using javascript to allow users to customize their profiles by dragging content around. Now I need a way to save the positions of each divider so that when anyone visits user X's profile they see the position user X saved everything to last. I was thinking of using javascript to return offsetLeft and offsetTop and save the values into a mysql database and then spit them back out when that users page is visited. Is their a better way or is the db idea good? Can I save a cookie when user X saves positions and send the cookie with saved positions to anyone that visits his page so they see his customization? Hope this isnt too vague Thanks
  10. Hey thanks for the info, Sorry for this being in the wrong section So the dragging of the windows work now after using some ajax. Now my question is how can I only allow the user that is logged in to drag stuff and no one else? Basically the user has a profile page that anyone can see. I want only the user to be able to position elements and save them so that when someone else views their profile it shows it how the user customized it. I hope that makes sense. Can i do this with cookies? Thanks
  11. Hey guys, I wanna know how google created the igoogle page where you can click and drag toolbars to customize positioning of elements. www.pageflakes.com has it too. Is this done in php? javascript? Can anyone point me to a tutorial or tell me what this technique is called so I can get more information? Thanks
  12. Thanks for the help, After reading about foreign keys stuff started making alot more sense Thanks again
  13. I fixed it, the SERVER[document_root] was takin it too far back on xampp. Anyway is this a good idea? Or should i just stick everything into one folder?
  14. When I removed the @ from mkdir its sayin permission denied...so i chmod 777 to the entire folder and used -R so that absolutely everything was 777 just to see if it worked but it still says permission denied...?
  15. Im still getting the failed to open stream error Heres what i have if($_SESSION['uid']) { $sql = "SELECT * FROM `users` WHERE `user_id`='".$_SESSION['uid']."'"; # when they login the SESSION['uid'] is set to their userid $res = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_assoc($res); $title = protect($_POST['title']); $target = $_SERVER[document_root]."/".$row['username']; @mkdir($target); $target = $target."/".basename($_FILES['song']['name']) ; $size = $_FILES['song']['size']; $song = $_FILES['song']['name'] ; if(move_uploaded_file($_FILES['song']['tmp_name'], $target)) { echo "<script language=\"Javascript\" type=\"text/javascript\"> alert(\"Your song has been uploaded\") document.location.href='profilecp.php'</script>"; } else { echo "<script language=\"Javascript\" type=\"text/javascript\"> alert(\"There was an error, try again\") document.location.href='profilecp.php'</script>"; } }
  16. What do you guys mean by sanitize? I have a function I call on anything posted from the user function protect($string) { $string = mysql_real_escape_string($string); $string = strip_tags($string); $string = addslashes($string); return $string; } Would that suffice?
  17. haha funny thing, i was just driving home and told myself to make sure I post a question about permissions on this thread. The site isnt live yet im making it on my localhost, im new to all this what should my permissions be? What would be an alternative? Should i just stick all the files in one folder and worry about organization through my database?
  18. Yeah they are logged by $_SESSION['uid'] , i tried that method first and it complains about failing to open a stream: No such file or directory, it fails to move tmp/randomletters to username/file.jpg
  19. Hello, I have file uploads on my site, each user can upload files. I want a way to organize the files by user. When I do move_uploaded_file it wants the target folder i want the file to go in. Is there any way I can have the folder created when the user uploads a file? Example: username: john -John uploads a file called pic.jpg -my php checks to see if a folder named john exists, if not it creates it and sticks pic.jpg into it. -if it exists it just moves pic.jpg into it Can this be done? Or should I just have all the files in one folder? Thanks
  20. Hey, I want to make a website where many users will be uploading many many many files. Videos pictures music and others. The two methods I came across where uploading the actual file into the database or uploading the file to the server and keeping a reference of it in the database. Is there a difference in terms of performance for the two methods? Is there any difference at all? Which would be better for me if my site were to have thousands and thousands of files uploaded and i wanted to be able to stream them back? If the second method is better can you point me in the right direction of getting it accomplished? Thanks
  21. Hey guys, Hoping you could help with designing my db. Very new to sql and databases so a bit confused. What I have so far is a users table with everything in it...i dont feel as though keeping everything in one table is a good idea. Heres how my app should work: - Two types of users: normal user, organization - normal user can setup a profile with this info [name,birthday,hometown,occupation,interests, can upload music,vids and pics] - an organization has this info in their profile[point of contact,location,state,phone, can also upload music,vids and pics] - an organization can post events and normal users cannot - a normal user can click a button to confirm them coming to the event - a way to list all events per state - a commenting system where registered users can comment on both types of users pages So im thinking these tables: users, events, profile, videos, pics, music I just dont know how everything would work together. More specifically which fields go under each table so that they are linked correctly Any advice? Thanks
  22. OK i wanna make sure i have this right before actually making changes to the db. Users table : id, name, username, password, email Files table : id, song_id, name, type, size, content(the actual file) To get user X's files i would select * from files where id=$_SESSION['id']; Now do i need song_id? If its the primary key and auto increments itll span across different users. ...sorry im still confused ???
  23. and how would i retrieve the the songs a certain user has? EDIT: nvm figured it out
×
×
  • 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.