Jump to content

MasterK

Members
  • Posts

    26
  • Joined

  • Last visited

    Never

Everything posted by MasterK

  1. I cannot figure this out and I know I'm just looking past the obvious... I am creating a simple "you are now leaving this website" page, Everything is setup, and all urls pointing to http://mysite.com?exit=http://externalsite.com, It should redirect to my exit.php which will redirect to the external site after 5 seconds. The problem is, the "http://" of the external site is causing a 403 forbidden, and even without it, anything with multiple &s isn't passing through. I cannot figure out how to get it to pass the full url to the exit.php...
  2. Like this? <?php echo "<textarea id=\"b_info\" name=\"b_info\" style=\"width: 327px; height: 185px\">$b_info</textarea>"; ?>
  3. <img src=../images/mbr_images/<?php echo H($mbr->getBarcodeNmbr()); $lower = ".jpg"; $upper = ".JPG"; if (file_exists('../images/mbr_images/' . H($mbr->getBarcodeNmbr()) . '.' . $lower)) { echo $lower; } else { echo $upper; } ?> height=150 width=100</img> I believe the problem is, This would echo eg, 1234..jpg as there is a period in the File_exists and in the $lower variable. This should work <img src=../images/mbr_images/<?php echo H($mbr->getBarcodeNmbr()); $lower = "jpg"; $upper = ".JPG"; if (file_exists('../images/mbr_images/' . H($mbr->getBarcodeNmbr()) . '.' . $lower)) { echo $lower; } else { echo $upper; } ?> height=150 width=100</img>
  4. Yea, after I posted I realised it was wrong I'm still learning Anyways, Here is how I would do it, Might not be the best way but it works... <?php include("header.php"); if (empty($_GET['boo'])) { $boo="news/show_news"; } else { $boo = $_GET['boo']; } include $boo . '.php'; include("footer.php"); ?> Posted at the same time as ProjectFear, but What he said
  5. You have the condition for If the Boo GET variable is empty, but your not telling it what to do if its NOT Empty
  6. Ok, I went and Edumacated myself a little, and then started playing with Javascript. and I have gotten what I'm going for. HERE But I am stumped on, Borders..? Such as the Trees, Water, Bushes, Edges of the Raised terrain.. How would I make it not possible to move the sprite there?
  7. Hello! I am really new to Ajax, been reading and playing with some tutorials and what not, But I haven't been able to find what I've been wanting to do. What I would like to be able to do is basically Walking on a map within the browser. Basically I want to move a little sprite across a image(map) when the arrow keys are pressed, and have certain parts of the image set as collision or un-walkable I know this can be done, I've seen other Browser based games doing it. Just haven't been able to find any examples/tuts online Any Sites/Tutorials/Hints/Tips are much appreciated Thanks in advance
  8. die(header('Location:http://www.google.com/')); This does work, I have used it a few times
  9. Alright let me try to explain. First. I messed up, I was searching for "Please enable scripts" but I was tired and didn't realize it searches the source and its there no matter what. So Ignore that, Its showing the Login form just fine. But, When I search for something that is only shown when you are NOT logged in such as "Reset my password" It comes back as found. Which means its not logging in So the problem is, The script is not logging into the site Here is my coding, All the information is correct so you can try it out <? $url = 'http://www.playerdex.com/index.php?'; // The URL to the accountmanagement page $f1 = 'U'; // Name of field1(ON THE WEBSITE YOU'RE TRYING TO LOGIN ON!) $f2 = 'P'; // Name of field2(ON THE WEBSITE YOU'RE TRYING TO LOGIN ON!) $v1 = 'sweetiepie'; // Value of field1(FROM THE WEBSITE YOU'RE TRYING TO LOGIN FROM!) $v2 = 'trin1224'; // Value of field2(FROM THE WEBSITE YOU'RE TRYING TO LOGIN FROM!) $find = 'Reset My Password'; // String to search for in the page you've logged in on $postchars = http_build_query( array($f1 => $v1, $f2 => $v2) ); $stream = stream_context_create( array('http' => array('method' => 'POST', 'header' => 'Content-Type: application/x-www-form-urlencoded', 'content' => htmlspecialchars_decode( $postchars ) ) ) ); // Creates an array of the sourcecode, and inputs the values of the field1 and field2 $content = file_get_contents($url, false, $stream); // Gets the sourcecode from the new page that is loaded after the input of the values. $search = strpos($content, $find); // Search the sourcecode for the specific string in the variable "find" if($search === false){ echo 'The login seems to be incorrect. Please try again, or check if you have a valid account <br> Found Reset My Password on the page!'; } // If the string wasn't found else { echo 'Your account is valid! Did not find Reset My Password on the page'; } // If the string was found ?>
  10. Uhm, No. I'm not stupid, Really I'm not, when I go to the website in my browser the login is fine. I go into Tools > Options > and the "Enable Javascript" is checked :-\
  11. So I've found the problem, It seems the problem is because the login form is not showing, It is giving "Please Enable Scripts To Log In".... Any Ideas how to Enable Javascript within this script? :s
  12. Well with the script I posted, It comes back with the "The login seems to be incorrect. Please try again, or check if you have a valid account" because It could not find the text string which would be there If it logged in. With that script its supposed, return "Your account is valid!" Sorry, this website, I just meant a general website. No it is not my website. It is Playerdex, a website to see your Pokemon/Badges etc for a Pokemon MMORPG. I created a fan site for it, and am Trying to create a script that logs into an account so I can have access to pull data from the Members only section, I have gotten it OKd by the Developers as long as I can figure out how to get it to work.
  13. I am trying to login to this website and pull data from it. But it doesn't seem to be working and I believe its because of the way their Login for is. The code I'm trying to use.... $url = 'URL'; // The URL to the accountmanagement page $f1 = 'accnr'; // Name of field1(ON THE WEBSITE YOU'RE TRYING TO LOGIN ON!) $f2 = 'pass'; // Name of field2(ON THE WEBSITE YOU'RE TRYING TO LOGIN ON!) $v1 = $_POST['acc']; // Value of field1(FROM THE WEBSITE YOU'RE TRYING TO LOGIN FROM!) $v2 = $_POST['pw']; // Value of field2(FROM THE WEBSITE YOU'RE TRYING TO LOGIN FROM!) $find = 'Welcome to your account'; // String to search for in the page you've logged in on $postchars = http_build_query( array($f1 => $v1, $f2 => $v2) ); $stream = stream_context_create( array('http' => array('method' => 'POST', 'header' => 'Content-Type: application/x-www-form-urlencoded', 'content' => htmlspecialchars_decode( $postchars ) ) ) ); // Creates an array of the sourcecode, and inputs the values of the field1 and field2 $content = file_get_contents($url, false, $stream); // Gets the sourcecode from the new page that is loaded after the input of the values. $search = strpos($content, $find); // Search the sourcecode for the specific string in the variable "find" if($search === false){ echo 'The login seems to be incorrect. Please try again, or check if you have a valid account'; } // If the string wasn't found else { echo 'Your account is valid!'; } // If the string was found *note* I know that doesn't pull the data, but I'm sure I can edit it to do that easy enough Thanks for any help!
  14. You just want it to show the Current Time and Date? // Assuming today is March 10th, 2001, 5:16:18 pm, and that we are in the // Mountain Standard Time (MST) Time Zone $today = date("F j, Y, g:i a"); // March 10, 2001, 5:16 pm More Info > http://www.php.net/manual/en/function.date.php
  15. lmao, Nice. and Ty, MadTechie, I am going to play with that code and those commands, hopefully I can get it
  16. Hello, I need pointed in the right direction, What I am trying to do is take an 468x100 image, and add 1-10 small images and specified names onto it, the image are hosted on my server. I would also like them to be saved as .PNG image files, with a specified name Ugly looking example of what I want it to do If there is anything else needed to point me in the right direction ask i'll try to explain
  17. lol? Who said it didn't change? Not I... The image is generated from a Database based on your current team in the game, It updates quite often
  18. Ok, So I was frustrated and before anybody had replied, I figured eh, What the heck, Imma try something crazy! and it WORKED! Here is what I am talking about. $url = "http://photo.playerdex.com/trainercard.php?ID="; $ourFileName = "$str.jpeg"; $ourFileHandle = fopen($ourFileName, 'w') fclose($ourFileHandle); $link = $url.$str; $source = file_get_contents($link); $myFile = "images/tc/$ourFileName"; $fh = fopen($myFile, 'w') fwrite($fh, $source); fclose($fh); I did not think this would work, But I thought I would try it anyways, and it works! This might not be surprising to many people, but I was surprised. Now I just need to get the Cronjob setup, I need to figure out how to make it update all the images that have been created..
  19. Ok, I have been googling for the last 1/2 hour trying to figure this out, Most likely I'm just not searching for the right thing. Here is what I want to do. I want to have a Text box which somebody will paste a URL into. The URL will be a PHP Image (Example) Now I want it to download that image as a JPEG to my Website, and name it that last 6 numbers of the URL (for the Example about it would be 185950.jpeg) Then I want it to redownload, and name it every 20minutes I just need pointed in the right direction here, because my Google searches are turning up nothing at all Thanks
  20. Cookie is being created I tried this <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "website"); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, "U=username&P=password"); curl_setopt ($ch, CURLOPT_COOKIEJAR, "cookie.txt"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); $login = curl_exec ($ch); $ch = curl_init(); curl_setopt ($ch, CURLOPT_COOKIEFILE, "cookie.txt"); curl_setopt($ch, CURLOPT_URL, "membership page"); $members = curl_exec ($ch); curl_close ($ch); print($members); ?> Is that what you meant? I am really an Idiot when it comes to cURL
  21. I've been playing around with every thing you guys have said, and I'm just not having any luck... My Code <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "website"); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, "U=username&P=password"); curl_setopt ($ch, CURLOPT_COOKIEJAR, "cookie.txt"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); $login = curl_exec ($ch); curl_setopt ($ch, CURLOPT_COOKIEFILE, "cookie.txt"); curl_setopt($ch, CURLOPT_URL, "membership page"); $members = curl_exec ($ch); curl_close ($ch); print($members); ?> It doesn't work, It's not logged when it shows the Membership page
  22. To get to the page, I just login and then Click on a link... Here is the Login code from the website I am trying to access <script type="text/javascript" language="javascript"> var tblLogin = document.getElementById("tdLogin"); if (tblLogin) { var strForm = '<table border="0">'; strForm = strForm + '<tr><td>Username:</td><td><input name="U"></td></tr>'; strForm = strForm + '<tr><td>Password:</td><td><input name="P" type="Password"></td></tr>'; strForm = strForm + '<tr><td colspan="2" align="center"><input name="sublogin" id="sublogin" type="submit" value="Login"></td></tr>'; strForm = strForm + '<tr><td colspan="2" align="center"><a href="lostpw.php">Reset My Password</a></td></tr>'; strForm = strForm + '</table>'; tblLogin.innerHTML = strForm; //<tr><td colspan="2" align="center"><a href="servers.php">Change Servers</a></td></tr> } /* var tdReset = document.getElementById("tdReset_PW"); if (tdReset) { tdReset.innerHTML = '<a href="lostpw.php">Reset My Password</a>'; } */ </script>
  23. Hello! I am trying to read data from a page that you have to be logged into to view, I am trying to use file_get_contents to do this, I have read that I need to use cURL, Is that true? Also, as Another Option, Well I'm not sure how to explain what I want to do but let me try I want to go to the remote website, Login, and then run my script as I'm logged in.. If that make sense Basically, Right now I go to the website, Login, and then use file_get_contents to pull the website and I'm not logged in, Is there anyway that I can make it read that I am logged in? :confused:
  24. thank you, ialsoagree. I am playing with that Code, now, trying to understand how to get it to Insert them into the databse Any other Tips/Hints/Suggestions are welcome
  25. I believe you just need to make it SELECT DISTINCT here.. $query = "SELECT post_subject, topic_id from phpbb_posts ORDER BY post_id DESC LIMIT 15"; So like this.. $query = "SELECT DISTINCT post_subject, topic_id from phpbb_posts ORDER BY post_id DESC LIMIT 15";
×
×
  • 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.