Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. have you tried it ? example in this code..
  2. please read the Header Pinned Post basically you have sent data to the screen before using session_start() in fact it tells you that the data was sent from in the message "headers already sent (output started at ######" working example <?php session_start(); echo "Hi Mom!"; ?> Failed example <?php echo "Hi Mom!"; session_start(); ?> thats that echo could be in an include used before the session_start();
  3. () = if ? = then : = else its quicker than. if ($link =="") { $s .= $d; }else{ $s .= "<a href=\"$link\">$d</a>"; }
  4. i think your asking for this! (only skimmed the post) <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <?php $filename="/txt/recentnews.txt"; $newdata = $_POST['newdata']; if (isset($_POST['frmSub'])) { $fd=fopen("/txt/recentnews.txt","w") or die ("Error opening file in write mode!"); fwrite($fd, $newdata); fclose($fd) or die ("Error closing file!"); echo "<font color=red>You successfully updated the Recent News section text content on the Home page!</font><br><br>\n"; }else{ $handle = fopen($filename, "r"); $newdata= fread($handle, filesize($filename)); fclose($handle); } ?> <html> <head> <title>Edit Recent News Content on Home Page</title> <link href="../styles.css" rel="stylesheet" type="text/css" /> </head> <body bgcolor="#747474"> <table width="800" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <th scope="col"><p align="left"><a href="index.php"><img src="logo.gif" width="234" height="244" border="0" /></a></p> <p align="left"><span class="style23">To update the text in the "Recent News " area on "Home" page, please type in your text below. <br /> <font color=red><b>NOTE:</b></font> place "<br><br>" when you want to start a new paragraph. (no quotation marks <br><br>).</span><br /> </p> <form method="post"> <div align="left"> <textarea name="newdata" rows="10" cols="90"> <?php echo stripslashes($newdata); ?> </textarea> <br /> <input type="submit" name="frmSub" value="Update/Change" /> </div> </form> <p align="left" class="style23"><a href="index.php">Return to Control Panel main page. </a></p></th> </tr> </table> </body> </html> EDIT:updated
  5. OK this is childish... heckenschutze please change your signature is not cleaver, lets just drop it, if you wanna flame each other find a flaming board..
  6. erm... LMAO yeah okay.. so it doesn't download which means the links inactive.. the problem with posting a link is its not part of the forum..
  7. try this addition $id = (int)$_GET['photo_id']; ///current if(!($_GET['photo_id']))//add { $id = 1; }
  8. this should work! (kinida hard to check while at work ) <?php include("config.php"); // get picture details $con; $id = (int)$_GET['photo_id']; $aid = (int)($_GET['album_id']); $where = ($aid>0)?" WHERE album_id = $aid":""; $sql = ("SELECT photo_title, photo_id, photo_location, album_id FROM photos $where LIMIT $id, 1"); $result = @mysql_query($sql) or die("Error retrieving record: " . mysql_error()); $num_rows = mysql_num_rows($result); if($num_rows > 0) { $row = @mysql_fetch_array($result); $photo_title = $row['photo_title']; $photo_loc = $row['photo_location']; $album = $row['album_id']; //check Next $nid = $id+1; $sql = ("SELECT photo_title, photo_id, photo_location, album_id FROM photos $where LIMIT $nid, 1"); $result = @mysql_query($sql) or die("Error retrieving record: " . mysql_error()); $num_rows = mysql_num_rows($result); $Next = ($num_rows > 0); //check Previous $pid = $id-1; $sql = ("SELECT photo_title, photo_id, photo_location, album_id FROM photos $where LIMIT $pid, 1"); $result = @mysql_query($sql) or die("Error retrieving record: " . mysql_error()); $num_rows = mysql_num_rows($result); $Previous = ($num_rows > 0); ?> <html> <head> <title>Gallery - <?php echo($photo_title); ?></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td> <table width="60%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td>Gallery - <?php echo($photo_title); ?></td> </tr> </table> <table width="60%" border="0" align="center" cellpadding="5" cellspacing="0"> <tr> <td> <img src="<?php echo($photo_loc); ?>" /> </td> </tr> </table> <table width="60%" border="0" align="center" cellpadding="3" cellspacing="0"> <tr> <td><a href="gallery.php">View Gallery</a></td> </tr> <tr> <td><a href="display_album.php?album_id=<?php echo ($album); ?>">Return to Photo Album</a></td> </tr> <tr> <td> <?php echo ($Previous === true)?"<a href='view_photo.php?photo_id=$pid&album _id=$album'>Previous</a>":"No more"; ?> </td> </tr> <tr> <td> <?php echo ($Next === true)?"<a href='view_photo.php?photo_id=$nid&album _id=$album'>Next</a>":"No more"; ?> </td> </tr> </table> </td> </tr> </table> </body> </html> <?php }else{ $msg .= "No photo selected! Please <a href=\"gallery.php\">choose an album</a> you would like to view."; // Display error message displayPage($msg); die(); } ?>
  9. use it as needed but remember, if you was the admin of that site and wanted block leachers, its a pain when someone finds a way to continue, theirs a few more things they can do to protect themselfs but still.. they have something inplace to make it hard to leach which to me means they don't want leachers.. ok i yapping now.. use as needed
  10. can you post the whole code again, so i can see
  11. its basically a .htaccess mod, it checks a few things, Oh @@@@ it.. they can still block your server IP, so don't leach like mad.. <?php $URL = "http://www.tadawul.com.sa/wps/portal/!ut/p/.cmd/cs/.ce/7_0_A/.s/7_0_4AI/_s.7_0_A/7_0_4AI"; $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 1); // Get the header curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // Allow redirection curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookie"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FILETIME, true); curl_setopt($ch, CURLOPT_URL, $URL); curl_setopt($ch, CURLOPT_REFERER,""); //Clear REFERER curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)"); //Fake Client $data = curl_exec($ch); curl_close($ch); echo $data; ?>
  12. UPDATE `cf_info` SET lastturn = `1191502291`; should be UPDATE `cf_info` SET lastturn = '1191502291'; or UPDATE `cf_info` SET lastturn = 1191502291;
  13. try this, first <?php $con; $id = (int)$_GET['photo_id']; $sql = "SELECT photo_title, photo_id, photo_location, album_id FROM photos LIMIT $id, 1"); $result = @mysql_query($sql) or die("Error retrieving record: " . mysql_error()); ?> if thats fine then try this <?php $con; $id = (int)$_GET['photo_id']; $aid = (int)($_GET['album_id']); $where = ($aid>0)?" WHERE album_id = $aid":""; $sql = "SELECT photo_title, photo_id, photo_location, album_id FROM photos $where LIMIT $id, 1"); $result = @mysql_query($sql) or die("Error retrieving record: " . mysql_error()); ?> Links echo ($Previous === true)?"<a href='view_photo.php?photo_id=$pid&album _id=$album'>Previous</a>":"No more";
  14. you lost me, what (doesn't) happen when you do what ? if theirs no next image then their shouldn't be a next button
  15. can you run that in PhpMyadmin and see if it works! it looks ok to me
  16. LOL $Previous = ($num_rows > 0); was on the first post the 2nd should of been $Previous = ($num_rows > 0)?true:false; oh well all is good
  17. your need to speak to them.. can it be done, without their permission, yes.. but i won't be party to that.. (sorry, if i blocked it mean i don't want leachers) proof of concept
  18. its probably blocking access from scrapping access, do you have permission to scrap ? if you they need to allow your server IP
  19. updated what () did i miss ? <?php include("config.php"); // get picture details $con; $id = (int)$_GET['photo_id']; $sql = "SELECT photo_title, photo_id, photo_location, album_id FROM photos WHERE photo_id = $id"); $result = @mysql_query($sql) or die("Error retrieving record: " . mysql_error()); $num_rows = mysql_num_rows($result); if($num_rows > 0) { $row = @mysql_fetch_array($result); $photo_title = $row['photo_title']; $photo_loc = $row['photo_location']; $album = $row['album_id']; //check Next $nid = $id+1; $sql = "SELECT photo_title, photo_id, photo_location, album_id FROM photos WHERE photo_id = $nid"); $result = @mysql_query($sql) or die("Error retrieving record: " . mysql_error()); $num_rows = mysql_num_rows($result); $Next = ($num_rows > 0):true:false; //check Previous $pid = $id-1; $sql = "SELECT photo_title, photo_id, photo_location, album_id FROM photos WHERE photo_id = $pid"); $result = @mysql_query($sql) or die("Error retrieving record: " . mysql_error()); $num_rows = mysql_num_rows($result); $Previous = ($num_rows > 0):true:false; ?> <html> <head> <title>Gallery - <?php echo($photo_title); ?></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td> <table width="60%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td>Gallery - <?php echo($photo_title); ?></td> </tr> </table> <table width="60%" border="0" align="center" cellpadding="5" cellspacing="0"> <tr> <td> <img src="<?php echo($photo_loc); ?>" /> </td> </tr> </table> <table width="60%" border="0" align="center" cellpadding="3" cellspacing="0"> <tr> <td><a href="gallery.php">View Gallery</a></td> </tr> <tr> <td><a href="display_album.php?album_id=<?php echo ($album); ?>">Return to Photo Album</a></td> </tr> <tr> <td> <?php echo ($Previous === true)?"<a href='view_photo.php?photo_id=$pid'>Previous</a>":"No more"; ?> </td> </tr> <tr> <td> <?php echo ($Next === true)?"<a href='view_photo.php?photo_id=$nid'>Next</a>":"No more"; ?> </td> </tr> </table> </td> </tr> </table> </body> </html> <?php }else{ $msg .= "No photo selected! Please <a href=\"gallery.php\">choose an album</a> you would like to view."; // Display error message displayPage($msg); die(); } ?>
  20. $data = file_get_contents("http://www.tadawul.com.sa/wps/portal/!ut/p/.cmd/cs/.ce/7_0_A/.s/7_0_4AI/_s.7_0_A/7_0_4AI"); or cURL
  21. #1. write the code maybe read up on ajax! i don't see a "problem"
  22. i assumed ID 1 has an image.. quick update.. totally untested <?php include("config.php"); // get picture details $con; $id = (int)$_GET['photo_id']; $sql = "SELECT photo_title, photo_id, photo_location, album_id FROM photos WHERE photo_id = $id"); $result = @mysql_query($sql) or die("Error retrieving record: " . mysql_error()); $num_rows = mysql_num_rows($result); if($num_rows > 0) { $row = @mysql_fetch_array($result); $photo_title = $row['photo_title']; $photo_loc = $row['photo_location']; $album = $row['album_id']; //check Next $nid = $id+1; $sql = "SELECT photo_title, photo_id, photo_location, album_id FROM photos WHERE photo_id = $nid"); $result = @mysql_query($sql) or die("Error retrieving record: " . mysql_error()); $num_rows = mysql_num_rows($result); $Next = ($num_rows > 0); //check Previous $pid = $id-1; $sql = "SELECT photo_title, photo_id, photo_location, album_id FROM photos WHERE photo_id = $pid"); $result = @mysql_query($sql) or die("Error retrieving record: " . mysql_error()); $num_rows = mysql_num_rows($result); $Previous = ($num_rows > 0); ?> <html> <head> <title>Gallery - <?php echo($photo_title); ?></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td> <table width="60%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td>Gallery - <?php echo($photo_title); ?></td> </tr> </table> <table width="60%" border="0" align="center" cellpadding="5" cellspacing="0"> <tr> <td> <img src="<?php echo($photo_loc); ?>" /> </td> </tr> </table> <table width="60%" border="0" align="center" cellpadding="3" cellspacing="0"> <tr> <td><a href="gallery.php">View Gallery</a></td> </tr> <tr> <td><a href="display_album.php?album_id=<?php echo ($album); ?>">Return to Photo Album</a></td> </tr> <tr> <td> <?php echo ($Previous)?""<a href='view_photo.php?photo_id=$pid'>Previous</a>:"No more"; ?> </td> </tr> <tr> <td> <?php echo ($Next)?""<a href='view_photo.php?photo_id=$nid'>Next</a>:"No more"; ?> </td> </tr> </table> </td> </tr> </table> </body> </html> <?php }else{ $msg .= "No photo selected! Please <a href=\"gallery.php\">choose an album</a> you would like to view."; // Display error message displayPage($msg); die(); } ?>
  23. extra info.. in addition to HuggieBear's message in the displayed list (search results) you can add a hyperlink with the ID ie $ID = $row['ID']; echo "<a href='edit.php?id=$ID'>edit</a>"; then in edit.php have something like $ID = (int)$_GET['id']; $sql = "SELECT * FROM table WHERE ID =$ID"; $result = mysql_query($sql) or die ("Can't execute query:" . mysql_error()); EDIT: updated (messed up with a Caps LOL)
  24. can you function lastturn($time){ $rs = mysql_connect( "localhost", "ace_ACE", "*****" ); $rs = mysql_select_db( "ace_cf" ); // SQL query for all entries in descending order $sql = "UPDATE `cf_info` SET lastturn = " . $time . ""; echo $sql; //add this (see what we get) $rs = mysql_query( $sql ) or die('Query:<br />' . $sql . '<br /><br />Error:<br />' . mysql_error()); }
  25. useful command mysql-num-rows example <?php $query = "SELECT * FROM table WHERE column LIKE '%$searchitem%'"; $result = mysql_query($query); $num_rows = mysql_num_rows($result); //number of records found If ($num_rows > 0) { // search results: }else{ // Error Message } ?> and welcome to the board as a side note, a better subject helps (ie display error if nothing is found)
×
×
  • 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.