Supa Comix
Members-
Content Count
24 -
Joined
-
Last visited
About Supa Comix
-
Rank
Newbie [Level 1]
-
Supa Comix started following Extracting Mysql Maths Using Php, Counting Down To A Time php or java?, Send Php Variable To Javascript and and 1 other
-
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);?>
-
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?
-
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.
-
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?
-
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?
-
Awesome its working properly now. Thank you very much
-
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.
-
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'?
-
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.
-
Okay groovy thanks people. Thats exactly what i wanted.
-
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>
-
erm if anyone knows the answer to this then please answer
-
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.
-
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); ?>; ?
-
ace. Thanks that is exactly what im looking for. Thanks a bunch