Jump to content

pixeltrace

Members
  • Posts

    577
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

pixeltrace's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. hi, i need help on my array code. what i want is to show 6 results into the the number i indicated but it doesn't seem to work. the result i want is something like this: result 1 result 2 result 3 result 4 result 5 result 6 below is my code: <?php $query = mysql_query("SELECT filename, title FROM jos_phocagallery WHERE published=1 ORDER BY RAND() LIMIT 6") or die(mysql_error());; $row = mysql_fetch_array( $query ); $filename[] = $row["filename"]; $title[] = $row["title"]; ?> <p> <img class="demo-fp-img demo-left" src="/images/phocagallery/thumbs/phoca_thumb_m_<?php echo $filename[0]; ?>" alt="<?php echo $title[0]; ?>" title="<?php echo $title[0]; ?>" border="0" /> <span class="demo-sep"> </span> <img class="demo-fp-img demo-left" src="/images/phocagallery/thumbs/phoca_thumb_m_<?php echo $filename[1]; ?>" alt="<?php echo $title[1]; ?>" title="<?php echo $title[1]; ?>" border="0" /> <span class="demo-sep"> </span> <img class="demo-fp-img demo-left" src="/images/phocagallery/thumbs/phoca_thumb_m_<?php echo $filename[2]; ?>" alt="<?php echo $title[2]; ?>" title="<?php echo $title[2]; ?>" border="0" /> </p> <p> <img class="demo-fp-img demo-left" src="/images/phocagallery/thumbs/phoca_thumb_m_<?php echo $filename[3]; ?>" alt="<?php echo $title[3]; ?>" title="<?php echo $title[3]; ?>" border="0" /><span class="demo-sep"> </span> <img class="demo-fp-img demo-left" src="/images/phocagallery/thumbs/phoca_thumb_m_<?php echo $filename[4]; ?>" alt="<?php echo $title[4]; ?>" title="<?php echo $title[4]; ?>" border="0" /><span class="demo-sep"> </span> <img class="demo-fp-img demo-left" src="/images/phocagallery/thumbs/phoca_thumb_m_<?php echo $filename[5]; ?>" alt="<?php echo $title[5]; ?>" title="<?php echo $title[5]; ?>" border="0" /> </p> hope you could help me with this. thanks!
  2. hi all, i need help. i need to lists down news items from an xml file which will be loaded in a php file. i haven't tried this eversince and i am seeking help on how to do this. hope someone can help me on this. thanks!
  3. Hi, I need help, i need to grab only a certain name from a url using php but i dont have any idea on how to do this. example: http://www.domainname.com/0903/filename.php?id=1 i only need to get "0903" hope you could help me with this. thanks so much!
  4. Hi, i need help. i got this script from this site http://kopicaidej.underground.si/?Kat=1 the script is a printer-friendly/ pdf/ send to a friend code all together my problem now is i cannot make it work i've attached the files for your reference. my test site can be view here http://www.manymoonshop.com/print/test.php what is happening here, whenever i click either the print/ pdf or send its just giving me a blank page. hope you could help me with this. thanks so much! [attachment deleted by admin]
  5. yah, i've read that the self keyword doesnt work on php 4 is there anyone who got a solution for this? because i also tried replacing self:: with $this-> but still it doesnt work and is giving me a different error. hope you could help me with this. thanks!
  6. hi, i need help i used the self function in my php code <?php self::show_prev_next_2($programmes_selected, $month_selected, $year_selected, $Itemid); ?> i tested this in my test server, which is using php 5.0.4 now, when i upload it into the live server which is using php 4.4.7 i am getting undefined class name "self" when i tried changing it to $this->show_prev_next_2($programmes_selected, $month_selected, $year_selected, $Itemid); i got this new error Fatal error: Call to a member function on a non-object in /home/manym4/public_html/sinagtala.net/jm/components/com_events/events.html.php on line 750 hope you could help me with this. thanks!
  7. sorry i havent used string_replace before. can you guide me on how to code it? thanks!
  8. hi, i need help, i have a code that will scrap info from another website and there is a part that i need to replace all <hr> tags with <div style="border-top:dotted 1px #cccccc; padding-bottom:10px"></div> my problem is, all tags with HR are being replaced including HR or HRef becoming <div style="border-top:dotted 1px #cccccc; padding-bottom:10px"></div>ef=domain.com below is my code <?php $url = "http://career.capitaland.com"; $ch = curl_init($url); // initialize curl handle //curl_setopt($ch, CURLOPT_URL, $url); // set url to post to //curl_setopt($ch, CURLOPT_FAILONERROR, 1); // Fail on errors curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // allow redirects curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable curl_setopt($ch, CURLOPT_PORT, 80); //Set the port number curl_setopt($ch, CURLOPT_TIMEOUT, 15); // times out after 15s curl_setopt($ch, CURLOPT_HEADER, false); $document = curl_exec($ch); // $originalString = '<hr>'; $pattern = '<hr>'; $replacement = 'div style="border-top:dotted 1px #cccccc; padding-bottom:10px"></div'; echo preg_replace($pattern, $replacement, $document); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td>test</td> </tr> <tr> <td> <? echo $document; exit; ?> </td> </tr> <tr> <td>test</td> </tr> </table> </body> </html> hope you could help me with this. thanks!
  9. i solve the problem already. thanks! this is the code that i used <? function show_latest_banner() { global $database, $mosConfig_live_site; $query = "SELECT id FROM #__events WHERE state =1 ORDER BY RAND() LIMIT 1"; $database->setQuery($query); $id = $database->loadResult(); $query = "SELECT images FROM #__events WHERE id =$id"; $database->setQuery($query); $image = $database->loadResult(); ?> <a href="index.php?option=com_events&task=event_details&id=<? echo $id ?>&Itemid=78"><img src="<?= $mosConfig_live_site .'/images/events/'.$image ?>" class="thumbimages"></a> <?php } show_latest_banner(); ?>
  10. hi, i need help, i need to display images limit to 1 only at random select. this is the code that i used <? function show_latest_banner() { global $database, $mosConfig_live_site; $query = "SELECT * FROM #__events WHERE state =1 ORDER BY publish_up RAND() LIMIT 1"; $database->setQuery( $query ); $rows = $database->loadObjectList(); ?> <img src="<?= $mosConfig_live_site .'/images/events/'.$rows->images ?>" class="thumbimages"> <br><br> <?php } show_latest_banner(); ?> i am getting an error and i dont know exactly how to fix it. this is the error i am getting Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /var/www/html/spa/modules/mod_events_banner.php on line 120 hope you could help me fix this. thanks!
  11. Hi, i need help and i need to know how am i going to strip of some characters into my database item example my Channel Description here<br /><ul><li>Channel Type: Philippine Channel</li><li>Schedules: <a href="images/schedules/abc.pdf" target="_blank">Latest Schedule</a></li><li>Website: <a href="http://www.abc.com.ph" target="_blank">www.abc.com.ph</a></li></ul> i only want to echo "images/schedules/abc.pdf" how can i strip off the other content? hope you could help me with this. thanks!
  12. Hi, we are doing a site w/o using database for our dynamic pages. what i wanted to happen is i have about us page about.php and inside i will have the following php codes <? include (aboutuscontent.php);?> and this page will contains some variables for the content like <? $content1 ='html content here'; $content2 ='html content here'; $content3 ='html content here'; $content4 ='html content here'; ?> now on my aboutus.php i will have this code <? if $_GET[id] == 1 {echo '$content1'; } ?> my question is for my codes inside aboutuscontent.php how will i be able to instead the html contents into so that i wont need to change the HTML codes (e.g " to ' ' must place \ ... and so on) hope you could help me with this. thanks!
×
×
  • 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.