Jump to content
xisto Community

Supa Comix

Members
  • Content Count

    24
  • Joined

  • Last visited

Everything posted by Supa Comix

  1. Right i set up the two pages. One reads the news and then uses an echo function to post it. The other links to the file but on running it just shows a black page with no source. This is the page its reading: (test.php on Gal x) <?php $sql = mysql_query("SELECT lastposter, lastposttid, lastpostsubject FROM mybb_forums WHERE fid='4'") or die("Error Line: " . mysql_error()); while ($row = mysql_fetch_array($sql)){ $lastposter = $row["lastposter"]; $lastpostid = $row["lastposttid"]; $lastpostsubject = $row["lastpostsubject"]; } echo("<font size='2'><a href='/forum/showthread.php?tid=" . $lastposttid . "'>" . $lastpostsubject . "</a></font><BR><font size='-3'>by: " . $lastposter . "</font>");?> and this is the code of the page "test2.php on the supa comix website: <?php// Open the Socket$fp = fsockopen('galx.ulmb.com;, 80);// Make the requestfputs($fp, "GET /test.php HTTP/1.1\n");fputs($fp, "Host: galx.ulmb.com, "Connection: Close\n\n"); // Send two New Lines to Signal Header End// Read the Output$readText = "";while(!feof($fp)){$readText .= fgets($fp);}// Never forget to end what you startedfclose($fp);?>
  2. Thanks but i don't fully understand the code...Would i be able to use php and mysql to set the Get code?Where would i put this?How would i extract the data at the supa comix end?
  3. I will explain what i am trying to do a bit clearer.Right On Website 1, we shall call this Supa Comix. This has its own forum and website and thus its own mysql databases and stuff... just easily configured.Now website 2, we shall call this Gal X is a website with its own seperate forum and website and stuff. But the Gal X website is completely seperate from the Supa Comix one. One is at http://forums.xisto.com/no_longer_exists/ and the other at http://forums.xisto.com/no_longer_exists/. Now what i'd like to do is to have it so that the Supa Comix website, on loading for example, will get some information from the Gal X mysql database and place it on the Supa Comix one. Now i was originally going to do this through the include function, by including a file on the Gal X website that got the data and stuck it into variables and then passed it back to the Supa Comix website so that it can be put on the page.It doesn't have to be complicated or anything. I am just curious about it as the two forums although seperate i would like to link. I don't want to join them together under one domain becuase of how big Gal X is going to be but i want them linked so that when i post news (for instance) on the Gal X forum that it is picked up by the Supa Comix website when the player opens up the news page on the Supa Comix website.EDIT: I have just found out that allow_url_fopen is disabled on the Supa Comix site.
  4. Well what im trying to do is just to get some data from another website of mine and then pasting it on another website. For instance if there is a variable in website 1, i would like to retrieve it from its mysql database and then print it on the second website.Is there a better way of doing it?
  5. Hello there. I am extremely curious into the include function. I have started using it a lot in order to cut down sizes of my websites as it prevents me having to type about 20 lines of code over and over again. But i am curious if i can use the include function to include pages that are not on the website. For instance, i have two pages: test.php This page is on one domain <?phpprint "Initiating Test...<BR>";include "http://forums.xisto.com/no_longer_exists/ "<BR>...test complete.";?> test2.phpThis page is at http://forums.xisto.com/no_longer_exists/ <?phpecho "<P>Hello World</P>";?> Yet when i run test.php all i get is: Initiating Test... ...test complete. Does anyone know why?
  6. Awesome its working properly now. Thank you very much
  7. Thanks but its not particulary working as i planned it.I have done some testing and playing around and as far as i know its not picking up if exactly 24 hours has passed and thus is printing the code (for example i am using the example which prints "echo $row[0] . "<br>";" I even tested it entering the data where it should come up with the correct information but even that didn't work. I have had a look at other bits of code but i am intrigued to this i even altered your code but none fitted or worked properly.
  8. so if i used the code: $sql = mysql_query("SELECT turnsusedup FROM tbl_ship WHERE shipid='$shipid' AND (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(turnsusedup) > (24 *60 *60))") or die("Line 52: " . mysql_error()); if (isset($sql)){ //do something } then this would retrieve the date if it was greater then 24 hours and then '//do something'?
  9. Right i am curious to how i would work out that exactly 24 hours has passed from a given variable. The variable is taken from a mysql database and reads as follows2007-11-22 10:05:49How would i check if 24 hours has passed or not? So it will work out that the 24 hours has passed at:2007-11-23 10:05:49I have tried datediff from mysql but that didn't quite work. Anyhelp would be great thanks.
  10. Okay groovy thanks people. Thats exactly what i wanted.
  11. Right i had a look across the internet as well as a search on here but you cannot search for anything less than 3 characters. But this is a really quick question. Would the following code allow me to send a php variable to a javascript? <?php$color = "green";?><script language="JavaScript">BackColor= "<?php echo($color);?>";</script>
  12. erm if anyone knows the answer to this then please answer
  13. Right, this is a really simple thing and it has me completely stumped. I'm working on this mini maths function and for some reason i cannot seem to do some simple math process using mysql. This is the code: (php btw), now assume that $date is actually a defined mysql date variable already successfully extracted. $sql = mysql_query("SELECT TO_DAYS('CURDATE()') - TO_DAYS('$date')");while ($row = mysql_fetch_array($sql)){ $diff = $row["TO_DAYS('CURDATE()') - TO_DAYS('$date')"];} Can anyone spot what im doing wrong becuase im just thrown by it.
  14. One last question. Say if i was recalling a date and time variable from a mysql database using php, in order to set the time could i just set the time Targetdate = <?php echo($date . $time); ?>; ?
  15. ace. Thanks that is exactly what im looking for. Thanks a bunch
  16. Hey i have been searching google and websites to find the answer to my question but i just get blasted with a bunch of code that isn't explained... So i would like to know how, in either php or java how i would get something to count down to a certain time, but not specifically a time, more like count down in days, hours, minutes and seconds and not require a refresh... like it count downs on the page every second... And that i can specify the days, hours etc in the start of the function such asfunction countdown($days, $hours, $minutes, $seconds){}Thanks
  17. Awesome. Thanks dude i tried that stuff and it now works! Thanks a lot!
  18. Right i have done a check for a tutorial on this as well as a question about it but php is not allowed in the search box. So i thought i'd just ask what i want to know.I have a form which uploads a file, it refreshes the page, uploads the file and then alerts the user to if the file has uploaded. To be honest im not sure why i keep getting the error. But here is the code:This is the form that is used for the user to select the file <form enctype="multipart/form-data" action="fileupload.php?op=up&user=<?php echo($user); ?>&fid=<?php echo($fid); ?>" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="100000000" /> Choose a file to upload: <input name="uploaded" type="file" id="uploaded" /> <input type="submit" value="Upload File" /> </form> This is the upload code if ($op == "up"){ $target = "uploads/"; $target = $target . basename($_FILES['uploaded']['name']); echo($target); if (move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo("The file ") . basename ($_FILES['uploadedfile']['name']). "has been uploaded!"; $filesize = $uploaded_size; $sql = mysql_query("UPDATE tbl_files SET filesize='$filesize' WHERE fileid='$fid'"); } else { echo ("Sorry, there was a problem uploading your file."); } } If you could point out any problems with it please do.
  19. right and i'd need to use the above code when someone logs in?
  20. Ah right ace. Thanks alot. I will give that a go very shortly. Just one last tiny question: $send .= "Referer: [url="http://forums.xisto.com/no_longer_exists/ I would replace the http://yahoo.com/ with my own website address i assume?
  21. Yeah it needs to be invisible and it will just update database/tables in the background. I just need to know how i'd go about setting that up. What pages i need etc. Where i'd need to put the code into update the tables etc. How would i go about getting to start, how i'd get it to do that infinite loop every 500 milliseconds... As soon as i know that i'll be happy [thanks for the help ur giving me btw... most appreciated!]
  22. Thanks people. I had a look at this Asynchronous Processing With PHP thing and i found that i didn't fully understand it. How would i set it up to, for example, do: print " - This is a test!"; At one minute intervals?What pages would i need to construct etc? Sorry for all the questions but im really having trouble getting my head around this!
  23. Right i did have a quick shufty around google as well as on the crontab stuff and i found out that my webhoster does not support cron functions. Is there any other way that people know? Preferably free ones...The server is apache (dunno if that helps or not...)
  24. Right me and my mate have begun planning to make a browser game (omg yes another guy wanting to do it). I know php, java, ajax, html, vb, C++ etc to a certain level like amateur. but thats not the point.I have been thinking about a lot of things an apart from the sheer hugeness of the size of such a project i'd like to know how the game functions in the background. With games such as ogame you have things happening in the background, fleets moving, attacks happening etc. I'd like to know how i'd get into sorting all that out. How i'd get attacks to function at the right time, how fleets get to their destination. How buildings finish, basically how the databases update themselves without anyone actually being online. Like the running whilst everyones asleep. That's the one problem i've got with such a project how i'd get it to work in the background... i've looked through other tutorials and scanned the forums nothing seems to be what i'd like to know.Does anyone know?
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.