Jump to content

kobmat

Members
  • Posts

    50
  • Joined

  • Last visited

    Never

About kobmat

  • Birthday 12/18/1979

Profile Information

  • Gender
    Male
  • Location
    Cebu, Philippines

kobmat's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Try this. $userimage_size = getimagesize("http://clanan.net/image.php?memberpic=".mysql_escape_string($_GET['id']); imagecopyresampled($im, $userimage, 30, 10, 0, 0, 100, 100, $userimage_size[0], $userimage_size[0]);
  2. Try to attach some code also.. maybe that will help.
  3. I think its is just a missing or misplaced }
  4. change echo ("<customers>"); while($row = mysql_fetch_array( $rs ) ) { echo ("<customer>"); for($i=0; $i< $fcount; $i++) { $tag = mysql_field_name( $rs, $i ); echo ("<$tag>". $row[$i]. "</$tag>"); } echo ("</customer>"); } echo ("</customers>"); to $xml = "<customers>"; while($row = mysql_fetch_array( $rs ) ) { $xml .= "<customer>"; for($i=0; $i< $fcount; $i++) { $tag = mysql_field_name( $rs, $i ); $xml .= "<$tag>". $row[$i]. "</$tag>"; } $xml .= "</customer>"; } $xml .= "</customers>";
  5. This generates the xml and echos it the browser <?php ob_start(); //Developed by -==[Mihir Shah]==- during my Project work //for the output header("Content-type: text/xml"); //to create connection to database $connection = mysql_connect("user","pass", "db") or die ("could not connect to database"); //to select the database here test is the sample database come with mysql $db = mysql_select_db("powercart",$connection) or die ("Couldn't select database."); $rs = mysql_query("SELECT * FROM customers",$connection) or die ("invalid query"); //count the no. of columns in the table $fcount = mysql_num_fields($rs); $h = ob_get_clean(); //you can choose any name for the starting tag echo ("<customers>"); while($row = mysql_fetch_array( $rs ) ) { echo ("<customer>"); for($i=0; $i< $fcount; $i++) { $tag = mysql_field_name( $rs, $i ); echo ("<$tag>". $row[$i]. "</$tag>"); } echo ("</customer>"); } echo ("</customers>"); $xml = ob_get_clean(); $fp = fopen("document.xml", "w"); if($fp) { fwrite($fp, $xml); } echo $h.$xml ?> or this <?php //Developed by -==[Mihir Shah]==- during my Project work //for the output header("Content-type: text/xml"); //to create connection to database $connection = mysql_connect("user","pass", "db") or die ("could not connect to database"); //to select the database here test is the sample database come with mysql $db = mysql_select_db("powercart",$connection) or die ("Couldn't select database."); $rs = mysql_query("SELECT * FROM customers",$connection) or die ("invalid query"); //count the no. of columns in the table $fcount = mysql_num_fields($rs); //you can choose any name for the starting tag $xml = "<customers>"; while($row = mysql_fetch_array( $rs ) ) { $xml .= "<customer>"; for($i=0; $i< $fcount; $i++) { $tag = mysql_field_name( $rs, $i ); $xml .= "<$tag>". $row[$i]. "</$tag>"; } $xml .= "</customer>"; } $xml .= "</customers>"; $fp = fopen("document.xml", "w"); if($fp) { fwrite($fp, $xml); } //remove this if you dont need to output to the browser echo $xml; ?>
  6. Try this // listing replay files (we need it even when viewing details for // prev/next links if (false !== ($replays_dir = opendir($w3g_path))) { $i = 0; while (false !== ($replay_file = readdir($replays_dir))) { if ($replay_file != '.' && $replay_file != '..' && false !== ($ext_pos = strpos($replay_file, '.w3g'))) { $replay_file = substr($replay_file, 0, $ext_pos); // create database file if replay is new if (!file_exists($txt_path.$replay_file.'.txt') && $replay_file != 'LastReplay') { // LastReplay additions just for my own purposes $replay = new replay($w3g_path.$replay_file.'.w3g'); $txt_file = fopen($txt_path.$replay_file.'.txt', 'a'); flock($txt_file, 2); fputs($txt_file, serialize($replay)); flock($txt_file, 3); fclose($txt_file); } $replays[filemtime($txt_path.$replay_file)] = $replay_file; $i++; } } closedir($replays_dir); if ($replays) { //This sorts all replays alphabetically ksort($replays); } else { echo('<p>Replay folder contains no replays!</p>'); } the lines of interest are: $replays[filemtime($txt_path.$replay_file)] = $replay_file; and ksort($replays);
  7. how about this function http://www.php.net/manual/en/function.html-entity-decode.php
  8. forgot to make the changes i added on the $dir line <?php echo "<html><head><title>Image Gallery</title></head><body"; $gallery = array(); // Change the following "application" to the exact location of the gallery path that you have $dir = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'application/gallery/'; $dh = opendir($dir); while($filename = readdir($dh)) { $filepath = $dir.$filename; if(is_file($filepath) and ereg("\.jpg$",$filename)) { $gallery[] = 'gallery/'.$filename; } } sort($gallery); foreach ($gallery as $image) { echo "<hr />"; echo "<img src='$image' /><br>"; } ?> </body></html>
  9. try this <?php echo "<html><head><title>Image Gallery</title></head><body"; $gallery = array(); // Change the following "application" to the exact location of the gallery path that you have $dir = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'application/gallery'; $dh = opendir($dir); while($filename = readdir($dh)) { $filepath = $dir.$filename; if(is_file($filepath) and ereg("\.jpg$",$filename)) { $gallery[] = 'gallery/'.$filename; } } sort($gallery); foreach ($gallery as $image) { echo "<hr />"; echo "<img src='$image' /><br>"; } ?> </body></html>
  10. try to change $dir = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'application/gallery'; to $dir = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'application/gallery/';
  11. Have you tried to use Imagepng($img_handle); instead of Imagejpeg($img_handle, "", 100);
  12. 1. open the text file using fopen in w+ mode 2.create a variable to temporarily storage of the line you are not looking for 3. read one line using fgets 4. compare the line contents with the data to be removed 5. if it is the one to be deleted skip that line, if its NOT add the line read to the temporary storage. 6. if its still not the end of file back to to set 3. use feof() 7. remove all the contents of the file using ftruncate() 8. write all the contents of the temp storage to the file Hope that helps
  13. try this <?php $myString = "Blue"; $hex = 10; printf ("My favorite color is %s and my lucky number is %x.", $myString, $hex); ?> printf echos the text to the screen and return the number of characters printed with in your case is 51, hence the 51 at the end of the sentence. if you really want the string to be in a variable use <?php $myString = "Blue"; $hex = 10; $formatted = sprintf ("My favorite color is %s and my lucky number is %x.", $myString, $hex); echo $formatted; ?>
  14. I think changing the all 120s on the script to a higher number will make the thumbnail bigger
×
×
  • 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.