Jump to content

sparq

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

sparq's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. What are you talking about This is all the code I have
  2. Here is an example of what I'm planning on implementing(a set is basically an album) Are there any problems with this structure? [attachment deleted by admin]
  3. I've started work on an image gallery, there are some features which I want to implement but I'm not sure what exactly will be required from the database structure in order to make this run smoothly. The database will need to track images, a way to keep track of what is basically an 'album' then keep track of tags within each image, along with certain products/objects associated with each album which will show up with the image. (either will be connected with the album or the individual image not sure the route I'm going quite yet) How many tables will I need? How should I connect them all together? Any good books which will help me in the venture?
  4. Logging in: <?php class Myspace { function login($username, $password) { $username = $_POST['user']; $password = $_POST['passwd']; $login_url = "https://secure.myspace.com/index.cfm?fuseaction=login.process"; $post_data = "ctl00%24ctl00%24cpMain%24cpMain%24LoginBox%24Email_Textbox=$username&ctl00%24ctl00%24cpMain%24cpMain%24LoginBox%24Password_Textbox=$password"; $ch = curl_init($login_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $login_url); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_AUTOREFERER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_MAXREDIRS, 10); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) "); curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,$post_data); $result = curl_exec($ch); curl_close($ch); echo $result; } } if($_POST['user'] && $_POST['passwd']) { $login = new Myspace; echo $login->login($_POST['user'],$_POST['passwd']); } else { echo "<html> <body> <form action='connect.php' method='POST'> <input type='text' name='user' /><br /> <input type='password' name='passwd' /><br /> <input type='submit' value='submit' /> </form> </form> </body> </html>"; } ?> This works fine, the output gives me the main home screen of myspace. Posting the status: <?php class Post { function StatusUpdate() { $url = "http://home.myspace.com/Modules/PageEditor/Handlers/Home/SaveStatusMood.ashx"; $post_data = urlencode("status=cheeellin&mood=(none)&smiley=http://x.myspacecdn.com/modules/common/static/img/spacer.gif"); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_AUTOREFERER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_MAXREDIRS, 10); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2)"); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,$post_data); $result = curl_exec($ch); curl_close($ch); echo $result; } } $post = new Post; echo $post->StatusUpdate(); ?> This is where the problem is. I can't figure out why, but for some reason this will not suffice to bringing about a change in the status of my profile. I'm fairly certain that the cookie is working properly, as viewing the home screen with the sole use of the cookie rather than logging in works fine. Maybe there are more cookie parameters that I am missing which myspace looks for before accepting a status update? How Myspace handles status updates(XXX = omitted data:) POST /Modules/PageEditor/Handlers/Home/SaveStatusMood.ashx HTTP/1.1 Host: home.myspace.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive Hash: XXX Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Referer: http://home.myspace.com/index.cfm?fuseaction=user Content-Length: 94 Cookie: XXX Pragma: no-cache Cache-Control: no-cache This is what I found out from firebug. I might just have to inspect the cookies a bit more to make sure there aren't any problems, but other than that I see no reason why the php code shouldn't work, assuming that there is a cookie in the txt file that has not expired before running such code.
  5. The expand all images button is actually a really good idea! Thanks for your input.
  6. It has a professional look to it, but you should definitely make some changes to the navigation and footer areas.
  7. In windowed mode it looks fine, but full screen on my wide screen monitor the content is awkwardly off to the side, which I personally find annoying, you should find a way to make the design so that you can center it.
  8. you page was 2.1MB, you need to down scale the quality of your images or use better formats, it might look great, but if someone is on a DSL connection they aren't going to want to wait for all of those images and such to load.
  9. I find it a little to complicated. You should make things a little more clear. It might make sense to you, but if someone else can't navigate your site, they're going to end up leaving.
  10. There's A LOT to be done, but I've been working on my own ajax based image board for the past 2-3 months in my spare time; just as a sort of fun project. Maybe I'll buy a domain for it, who knows... Oh and don't mind the content, that's what usually comes with this type of forum.. http://dev.foundation-stone.net/techchan/index.php
  11. I've been searching the web for the longest time trying to figure out how to find all occurrences of ">*some number*" with javascript, could anyone clue me into how I can get this to work so that it will return not just the first occurrence which is happening with this code I've come up with so far var str = ">1292389223 randomrandomrandom >1312424243 randomrandomrandomrandom >24294924"; var regexp = /(>\d{1,})/; var matches_array = str.match(regexp); document.write(matches_array); EDIT: wow that was incredibly easy, adding a 'g' to the end of my var regexp fixed my problem...
  12. Would session_set_cookie_params(3600); be enough before each session_start(); to keep it going for a full hour?
  13. No the session is definitely there, I've gotten that much to work
  14. I've been trying to implement a system to where I can login and use my admin panel through a simple script, but it seems that it only takes 10-20 minutes for the php session to expire. How can I prolong this until either the browser is closed or I manually log out? Heres my code so far Admin login <?php session_start(); ?> <html> <?php echo "<a href='index.php'>Home</a><br />"; if(!isset($_SESSION['myusername'])){ echo "<form action='admin_l.php' method='post'> <input type='text' name='myusername' /><br /> <input type='password' name='mypassword' /><br /> <input type='submit' value='submit' /> </form>"; } else { echo "Already Logged in <a href='logout.php'>Click here</a> to logout"; } ?> </html> admin_l.php <?php session_cache_limiter ('private_no_expire'); session_start(); $host = "*****"; $username = "*****"; $password = "*****"; $db_name = "*****"; $tbl_name = "adminmem"; mysql_connect($host,$username,$password)or die("cannot connect"); mysql_select_db($db_name)or die("cannot select DB"); $myusername = $_POST['myusername']; $mypassword = $_POST['mypassword']; $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $sql = "SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result = mysql_query($sql); $count = mysql_num_rows($result); if($count==1) { $_SESSION["myusername"] = $myusername; $_SESSION["mypassword"] = $mypassword; header("location:index.php"); } else { echo "login incorrect"; } ?>
×
×
  • 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.