interpim
Members-
Posts
303 -
Joined
-
Last visited
Never
Everything posted by interpim
-
google search for proxy sites... then visit each one and do a whois search to find out the IP addresses.
-
you could ban the proxy ip's, but you cannot see the persons ip using it... thats the point of them.
-
http://us3.php.net/ftp
-
http://www.google.com/search?q=FFMPEG&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
-
great... now, use those forms, to submit to a script which will insert the data entered into a database.
-
you would need to basically set up your pc as a server and connected to the internet with a Static IP or domain registered to that IP.
-
FFMPEG is a graphics toolkit that can be used to process video files such as creating thumbs from mpegs
-
http://www.phpfreaks.com/tutorials.php
-
Host doesn't support Cron Jobs... what to do?
interpim replied to interpim's topic in PHP Coding Help
Well... remote-cron.com wasn't working evidently, so I found another, and It does work but restricts you to only once an hour. here is that site address if anyone is interested... http://www.webcron.org/ -
open database and connect... then, query getting the data you want... ie, SELECT * FROM main WHERE page_title='$page_title' then based off of that, you can set your variables for title, content, etc... and echo those out to the page.
-
Host doesn't support Cron Jobs... what to do?
interpim replied to interpim's topic in PHP Coding Help
well... I think i found a solution, If anyone is interested ask and I will update with how it goes... otherwise this is what I am now going to try... http://www.remote-cron.com/index.php -
do you have a mail server installed?
-
Host doesn't support Cron Jobs... what to do?
interpim replied to interpim's topic in PHP Coding Help
well... what I am doing is making a little game in php... basically I want to give all the users x number of turns every x number of minutes... The site isn't really accessed often enough to rely on someone to log in to call the script... so I am not sure what will work that will give everyone a fair amount of turns. I was thinking of taking a timestamp everytime a user used a turn, then next time he loads a page i would call a function that would check current time against his last turn time and increment it 1 time for every x amount of units went by since that timestamp... but that limits me to setting it off of their time they used the turn... not every 15 minutes which is what I would like to do. -
if you want to get what some other page is displaying that will not work... if you are writing a page, and you want google to be your title... the you would assign the string google to the variable $title and echo (or print) that in between your title tags.
-
Well, what I want to do is, run a script once every say, 30 minutes... basically run through a script and process every row in my database. Well... I figured a Cron Job was the easiest way to go about this... but my host doesn't support it at the moment. Is there any other way to get a script to run automattically without user intervention on a set time schedule?
-
you mean like checkboxes? as in selecting them? if so... google html table tags... or go here http://www.w3.org/TR/html4/interact/forms.html
-
try changing $PHP_SELF to multiple_pages.php
-
what is the code?
-
Hi Art it's a brain convention O.o
-
Thank you for the help... with a little bit of tweaking I finally got it working Here is what I came up with in the end... <?php include('config.php'); mysql_connect($server,$username,$password); mysql_select_db($database) or die("unable to select database because ".mysql_error()); // how many rows to show per page $rowsPerPage = 30; // by default we show first page $pageNum = 1; // if $_GET['page'] defined, use it as page number if(isset($_GET['page'])) { $pageNum = $_GET['page']; } // counting the offset $offset = ($pageNum - 1) * $rowsPerPage; $query = " SELECT * FROM main WHERE level > 0 ORDER BY level LIMIT $offset, $rowsPerPage"; $result = mysql_query($query) or die('Error, first query failed'); // print the random numbers $bgcolor="#E0E0E0"; echo "<center><table border='2'><tr bgcolor='E0E0E0'><td>ID</id><td>NAME</td><td>LEVEL</td><td>WINS</td><td>LOSSES</td><td> </td></tr>"; while($row = mysql_fetch_assoc($result)) { if($row['user_name'] != $user){ if ($bgcolor == "#E0E0E0"){ $bgcolor = "#FFFFFF"; }else{ $bgcolor = "#E0E0E0"; } echo '<tr bgcolor='.$bgcolor.'><td>' . $row['id'] . '</td><td>' . $row['toon_name'] . '</td><td>' . $row['level'] . '</td><td>' . $row['win'] . '</td><td>' . $row['loss'] . '</td><td><a href="battle.php?atk=' . $row['id'] . '">ATTACK!</a></td></tr>'; } } echo "</table>"; // how many rows we have in database $query = "SELECT COUNT(level) AS numrows FROM main"; $result = mysql_query($query) or die('Error, second query failed'); $row = mysql_fetch_array($result, MYSQL_ASSOC); $numrows = $row['numrows']; // how many pages we have when using paging? $maxPage = ceil($numrows/$rowsPerPage); // print the link to access each page $self = $_SERVER['PHP_SELF']; $nav = ''; for($page = 1; $page <= $maxPage; $page++) { if ($page == $pageNum) { $nav .= " $page "; // no need to create a link to current page } else { $nav .= " <a href=\"$self?page=$page\">$page</a> "; } } // creating previous and next link // plus the link to go straight to // the first and last page if ($pageNum > 1) { $page = $pageNum - 1; $prev = " <a href=\"$self?page=$page\">[Prev]</a> "; $first = " <a href=\"$self?page=1\">[First Page]</a> "; } else { $prev = ' '; // we're on page one, don't print previous link $first = ' '; // nor the first page link } if ($pageNum < $maxPage) { $page = $pageNum + 1; $next = " <a href=\"$self?page=$page\">[Next]</a> "; $last = " <a href=\"$self?page=$maxPage\">[Last Page]</a> "; } else { $next = ' '; // we're on the last page, don't print next link $last = ' '; // nor the last page link } // print the navigation link echo $first . $prev . $nav . $next . $last; // and close the database connection mysql_close(); // ... and we're done! ?>
-
Tried that script... I am getting nothing from it here is what I have trying that tutorial script... <?php include 'config.php'; mysql_connect($server,$username,$password); mysql_select_db($database) or die("unable to select database because ".mysql_error()); // how many rows to show per page $rowsPerPage = 30; // by default we show first page $pageNum = 1; // if $_GET['page'] defined, use it as page number if(isset($_GET['page'])) { $pageNum = $_GET['page']; } // counting the offset $offset = ($pageNum - 1) * $rowsPerPage; $query = " SELECT FROM main WHERE level > 0 " . " LIMIT $offset, $rowsPerPage"; $result = mysql_query($query) or die('Error, query failed'); // print the random numbers $bgcolor = "#E0E0E0"; // light gray echo "<center><table border='2'><tr bgcolor='E0E0E0'><td>ID</id><td>NAME</td><td>LEVEL</td><td>WINS</td><td>LOSSES</td><td> </td></tr>"; while($row = mysql_fetch_array($result)) { if ($bgcolor == "#E0E0E0"){ $bgcolor = "#FFFFFF"; }else{ $bgcolor = "#E0E0E0"; } echo("<tr bgcolor=".$bgcolor.">n<td>"); echo($row["toon_name"]); echo("</td>n<td>"); echo($row["level"]); echo("</td>n</td>"); echo($row["win"]); echo("</td>n</td>"); echo($row["loss"]); echo("</td>n</td>"); echo("a href=\"battle.php?atk=$row['id']>ATTACK THIS PLAYER!</a></td></tr>"); } echo "</table>"; // how many rows we have in database $query = "SELECT COUNT(level) AS numrows FROM main"; $result = mysql_query($query) or die('Error, query failed'); $row = mysql_fetch_array($result, MYSQL_ASSOC); $numrows = $row['numrows']; // how many pages we have when using paging? $maxPage = ceil($numrows/$rowsPerPage); // print the link to access each page $self = $_SERVER['PHP_SELF']; $nav = ''; for($page = 1; $page <= $maxPage; $page++) { if ($page == $pageNum) { $nav .= " $page "; // no need to create a link to current page } else { $nav .= " <a href=\"$self?page=$page\">$page</a> "; } } // creating previous and next link // plus the link to go straight to // the first and last page if ($pageNum > 1) { $page = $pageNum - 1; $prev = " <a href=\"$self?page=$page\">[Prev]</a> "; $first = " <a href=\"$self?page=1\">[First Page]</a> "; } else { $prev = ' '; // we're on page one, don't print previous link $first = ' '; // nor the first page link } if ($pageNum < $maxPage) { $page = $pageNum + 1; $next = " <a href=\"$self?page=$page\">[Next]</a> "; $last = " <a href=\"$self?page=$maxPage\">[Last Page]</a> "; } else { $next = ' '; // we're on the last page, don't print next link $last = ' '; // nor the last page link } // print the navigation link echo $first . $prev . $nav . $next . $last; // and close the database connection mysql_close(); // ... and we're done! ?>
-
Newbie...PHP code shows in my browser page and not the result.
interpim replied to lariat1997's topic in PHP Coding Help
sounds to me that php isn't installed correctly. check with <?php phpinfo(); ?> if that file shows nothing, then php isn't working. -
OK... I got my script working before, displaying everything... but I decided I wanted to paginate the results. Well, after all the work boo_lolly went through to help me getting the other script working I have broken it again LOL... well, here is my code... I am getting no output, and honestly, I am setting myself up to get embarrassed again i know. <?php include('config.php'); include('includes/functions.php'); loggedin_check(); $user=$_COOKIE['user']; if(!isset($_GET['page'])){ $page=1; }else{ $page=$_GET['page'] } $max_results=20; $from = (($page * $max_results) - $max_results); $sql = mysql_query("SELECT * FROM main WHERE level > 0 ORDER BY level LIMIT $from, $max_results"); echo "<center><table border='2' bgcolor=#aaaaaa><tr><td>ID</id><td>NAME</td><td>LEVEL</td><td>WINS</td><td>LOSSES</td><td> </td></tr>"; while($row = mysql_fetch_assoc($sql)){ if($row['user_name'] != $user){ echo '<tr><td>' . $row['id'] . '</td><td>' . $row['toon_name'] . '</td><td>' . $row['level'] . '</td><td>' . $row['win'] . '</td><td>' . $row['loss'] . '</td><td><a href="battle.php?atk=' . $row['id'] . '">ATTACK!</a></td></tr>'; } } echo "</table>"; $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM main"),0); $total_pages = ceil($total_results / $max_results); echo "SELECT A PAGE<br />"; if($page > 1){ $prev =($page - 1); echo "<a href=\"" .$_SERVER['PHP_SELF']."?page=$prev\"><<PREVIOUS</a> "; } for($i=1;$i<=$total_pages;$i++){ if(($page)==$i){ echo "$i "; }else{ echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$i\">$i</a> "; } } if($page < $total_pages){ $next = ($page + 1); echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$next\">NEXT>></a>"; } echo "</center>"; ?>
-
[SOLVED] displaying database and getting unwanted results...
interpim replied to interpim's topic in PHP Coding Help
$user is pulled from a cookie... when I echo user to check if it holds any data it prints the right information. LOL... and reading what you just posted just made me realize I need to pull the user_name field from the database... Thanks for your help. I can't believe how stupid this makes me feel :/