SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 29

Thread: Easy problem..

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Bucharest
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Red face Easy problem..

    I have this php code:

    <?php

    $word = "hello all"

    echo $word;
    ?>

    How do i type, if i want to add after hello and before all 10 lines of some other php code (this 10 lines will print something)


    Thanks!

  2. #2
    SitePoint Enthusiast
    Join Date
    Jan 2004
    Location
    Rotterdam
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't understand the question. Only thing I notice about the code you post is that you're missing the semicolon (;) after the variable assignment.

    But it would be perfectly fine to do something like:
    PHP Code:
    $word "hello all";
    echo 
    'something else';
    echo 
    'yet some more text';
    echo 
    'and even more!';
    echo 
    $word

  3. #3
    Crazy Webmaster Cr0CX's Avatar
    Join Date
    Dec 2003
    Location
    WWW
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    or maybe this?

    PHP Code:
    <?php

    $word 
    "hello all"
    echo $word;

    $word2 "hello again"
    echo $word2;

    print 
    "$word\n$word2";
    ?>
    Run a site? over 1,000 uniques a day? PM me for link exchange.

  4. #4
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    or maybe this...

    PHP Code:
    <?php

    $word 
    "hello all"
    $words explode(" "word);

    echo 
    $words[0] . " 10 lines of code " $words[1];
    ?>

  5. #5
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Bucharest
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have
    <?php

    $word = "hello all"

    echo $word;
    ?>

    and 1.php

    <?php
    mysql_connect('localhost', '', '');
    mysql_select_db('');

    $string = "music+remix+mp3";

    $keyword = explode ('+', $string);
    $count = count($keyword);
    $field = 'keyword';
    $like = '';
    for($i=0;$i<$count;$i++)
    {
    if($i==0)
    {
    $like .= "$field LIKE '%$keyword[$i]%'";
    }
    else
    {
    $like .= "OR $field LIKE '%$keyword[$i]%'";
    }
    }

    $query = "SELECT * FROM terms WHERE $like";
    $display = @mysql_query($query);
    echo $display;
    ?>


    I want to add the code from 1.php after hello and between all

    Now you understand?


    Thanks!

  6. #6
    SitePoint Zealot daveporter's Avatar
    Join Date
    Mar 2002
    Location
    Perth, Western Australia
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi there,

    Apart from the missing semi-colon that someone else already mentioned, paste it in and it should work fine !

    Have you tried and are getting a specific error ?

    Let us know.

    regards, Dave Porter

  7. #7
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,485
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    How about
    PHP Code:
    <?php
    mysql_connect
    ('localhost''''');
    mysql_select_db('');
    $string "music+remix+mp3";
    $keyword explode ('+'$string);
    $count count($keyword);
    $field 'keyword';
    $like '';
    for(
    $i=0;$i<$count;$i++){
      if(
    $i==0){
        
    $like .= "$field LIKE '%$keyword[$i]%'";
      }else{
        
    $like .= "OR $field LIKE '%$keyword[$i]%'";
      }
    }
    $query "SELECT * FROM terms WHERE $like";
    $display = @mysql_query($query);
    echo 
    'hello all';
    echo 
    $display;
    ?>
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

  8. #8
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Bucharest
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Ok

    Ok...



    If just paste the code will display me a blank page... look into index3.php.txt

    Thanks!
    Last edited by sosoro; Sep 11, 2005 at 06:43.

  9. #9
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,485
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The attachment you sent me will take hours to approve, please send it to me via PM
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

  10. #10
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,485
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    OK I have the attachment.

    Question, Are you sure this script works on its own, there is a lot of dodgy code in there ?

    I don't want to insert you other script if the original doesn't work in the first place !!
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

  11. #11
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,485
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    OK, despite my reservations on your first script, I've put the second script inside it as you requested.

    Please learn to format your code , reading it is a nightmare, also why did you have an empty line between every line of code ? I've formatted it as much as I can.

    BUT

    In your first script there are many if { } else {} without the second set of brackets !! this makes it imposible to know what you are doing, and I suspect that the script won't work correctly because of it.

    PHP Code:
    <?
    include("main_inc.php");
    include(
    "ettings_class.php");
    include(
    "pager_class.php");
    include(
    "includes/ads.php");
    include(
    "last_s.php");
    include(
    "last_dreapta.php");
    include(
    "last_download.php");
    include(
    "last_top.php");
    include(
    "last_extra.php");
    db_connect();
    $_settings = new Settings();
    $search_cats = array('web'=>'Web','news'=>'Stiri','images'=>'Poze','video'=>'Video','audio'=>'Audio','shopping'=>'Shopping');
    //array('web'=>'Web','news'=>'News','images'=>'Pictures','video'=>'Video','audio'=>'Audio','shopping'=>'Shopping');
    $type = isset($_GET['type']) ? $_GET['type'] : 'web';
    $keywords = isset($_GET['search']) ? $_GET['search'] : '';
    $parsed_keywords htmlspecialchars(chop($keywords));
    $prepared_keywords str_replace(" ","+",chop($keywords));
    $tabs "";
    if (
    $type == 'compare'){
    $old_type $type;
    $type 'shopping';
    }else
    $old_type $type;
    foreach(
    $search_cats as $search_type=>$display_name){
        if (
    $search_type == $type){
         
    $tabs .= '';
        }else{
         
    $tabs .= '';
        }
    }
    if ((
    strlen(chop($keywords)) == 0)){
        
    $content '
    <table width="100%" cellSpacing=0 cellPadding=0>
        <tr><td align="center">
        <SPAN class=tabSpace></SPAN><A class=tabOn href="http://www.bestweb.ro">Home</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://chat.bestweb.ro">Chat</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://www.bestweb.ro/get">Download</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://forum.bestweb.ro">Forum</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://sms.bestweb.ro">SMS & GSM</A><SPAN class=tabSpace></SPAN>
        </td></tr></table>
        <DIV class="searchBar2">
        <TABLE cellSpacing=0 cellPadding=0 border=0 width="100%" height="70">
        <TR>
        <TD align=center>
        <SPAN class=query>
        <form name="searchform" onSubmit="return dosearch();">
        <input type="text" name="searchterms" value="'
    .$parsed_keywords.'">
        <select name="sengines">
        <option value="http://www.bestweb.ro/get/cauta.html?query=" selected>in Download</option>
        <option value="http://cauta.bestweb.ro/?type=shopping&search=" selected>in Shopping</option>
        <option value="http://cauta.bestweb.ro/?type=news&search=" selected>in Stiri</option>
        <option value="http://cauta.bestweb.ro/?type=images&search=" selected>in Poze</option>
        <option value="http://cauta.bestweb.ro/?type=video&search=" selected>in Video</option>
        <option value="http://cauta.bestweb.ro/?type=audio&search=" selected>in Audio</option>
        <option value="http://cauta.bestweb.ro/?type=web&search=" selected>pe Web</option>
        '
    .$tabs.'
        </select>
        <input type="submit" name="SearchSubmit" value="Search">
        </form>
        </SPAN>
        </TD>
        </TR>
        </TABLE>
        </DIV>
        </form>'
    ;
    }else{
        
    $from_cache FALSE;
        
    add_stat_to_db($prepared_keywords,$type);
        if (
    $_settings->is_cache_used()){
         
    $result check_chache($_SERVER['QUERY_STRING'],$_settings->get_cache_time());
        }else
        
    $result TRUE;
        
    $type $old_type;
        if ((
    $_settings->is_cache_used() && ($result === FALSE)) || ($result === TRUE)){
    switch (
    $type){
         case 
    'web':{
         include(
    "includes/classes/web_search_class.php");
         
    $results = new WebSearch($_settings,$prepared_keywords);
         
    $results_html $results->get_results();
         
    $total_found_string $results->m_total_found_string;
         }break;
         case 
    'news':{
         include(
    "includes/classes/news_search_class.php");
         
    $results = new NewsSearch($_settings,$prepared_keywords);
         
    $results_html $results->get_results();
         
    $total_found_string $results->m_total_found_string;
         }break;
         case 
    'images':{
         include(
    "includes/classes/images_search_class.php");
         
    $results = new ImagesSearch($_settings,$prepared_keywords);
         
    $results_html $results->get_results();
         
    $total_found_string $results->m_total_found_string;
         }break;
         case 
    'video':{
         include(
    "includes/classes/video_search_class.php");
         
    $results = new VideoSearch($_settings,$prepared_keywords);
         
    $results_html $results->get_results();
         
    $total_found_string $results->m_total_found_string;
         }break;
         case 
    'audio':{
         include(
    "includes/classes/audio_search_class.php");
         
    $results = new AudioSearch($_settings,$prepared_keywords);
         
    $results_html $results->get_results();
         
    $total_found_string $results->m_total_found_string;
         }break;
         case 
    'shopping':{
         include(
    "includes/classes/shopping_search_class.php");
         
    $results = new ShoppingSearch($_settings,$prepared_keywords);
         
    $results_html $results->get_results();
         
    $total_found_string $results->m_total_found_string;
         }break;
         case 
    'compare':{
         include(
    "includes/classes/compare_shopping_search_class.php");
         
    $results = new CompareShoppingSearch($_settings,$prepared_keywords);
         
    $results_html $results->get_results();
         
    $total_found_string $results->m_total_found_string;
         }break;
    }
    $adsp = isset($_GET['pos']) ? $_GET['pos'] : 1;
    $top_ads get_ads('top',$prepared_keywords,$adsp);
    $side_ads get_ads('side',$prepared_keywords,$adsp);
    $bottom_ads get_ads('bottom',$prepared_keywords,$adsp);
    if (
    $type == 'compare')
         
    $type 'shopping';
    $content '
    <table width="100%" cellSpacing=0 cellPadding=0>
         <tr><td align="center">
         <SPAN class=tabSpace></SPAN><A class=tabOn href="http://www.bestweb.ro">Home</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://chat.bestweb.ro">Chat</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://www.bestweb.ro/get">Download</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://forum.bestweb.ro">Forum</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://sms.bestweb.ro">SMS & GSM</A><SPAN class=tabSpace></SPAN>
         </td></tr></table>
         <DIV class="searchBar2">
         <TABLE cellSpacing=0 cellPadding=0 border=0 width="100%" height="70">
         <TR>
         <TD align=center>
         <SPAN class=query>
         <form name="searchform" onSubmit="return dosearch();">
         <input type="text" name="searchterms" value="'
    .$parsed_keywords.'">
         <select name="sengines">
         <option value="http://www.bestweb.ro/get/cauta.html?query=" selected>in Download</option>
         <option value="http://cauta.bestweb.ro/?type=shopping&search=" selected>in Shopping</option>
         <option value="http://cauta.bestweb.ro/?type=news&search=" selected>in Stiri</option>
         <option value="http://cauta.bestweb.ro/?type=images&search=" selected>in Poze</option>
         <option value="http://cauta.bestweb.ro/?type=video&search=" selected>in Video</option>
         <option value="http://cauta.bestweb.ro/?type=audio&search=" selected>in Audio</option>
         <option value="http://cauta.bestweb.ro/?type=web&search=" selected>pe Web</option>
         '
    .$tabs.'
         </select>
         <input type="submit" name="SearchSubmit" value="Search">
         </form>
         </SPAN>
         </TD>
         </TR>
         </TABLE>
         </DIV>
         </form>
         <DIV class=resultHeading>
         <TABLE cellSpacing=0 cellPadding=0 width="100%" border="0">
    <TR>
         <TD class=inf align="right">
         '
    .$total_found_string.'
         </TD>
    </TR>
    </TABLE>
    </DIV>
    <table width="100%" border="0">
    <tr>
         <!--top_ads-->
         <td align="left" colspan="2">
         <table border="0" width="100%" bgcolor="#f8fff5" style="border: 1px; border-style: solid; border-color: #b6dff6">
         <tr>
         <td align="left">
         <table border="0" cellpadding="5" cellspacing="0" width="100%" bgcolor="#F8FFF5" bordercolor="#111111">
         <tbody><tr>
         <td valign="top" width="47%">
         <table border="0" cellpadding="2" cellspacing="0" width="100%">
         <tbody><tr><td align="left" style="COLOR:#000000;font-size:12px;"><b>Ultimele topicuri pe forum</b></td></tr>
    <tr><td>'
    .To(9).'</td></tr>
         </tbody></table>
         </td>
         <td valign="top" width="32%">
         <table border="0" cellpadding="2" cellspacing="0" width="100%">
    <tbody><tr><td align="left" style="COLOR:#000000;font-size:12px;"><b>Ultimele programe adaugate</b></td></tr>
    <tr><td>'
    .Dow(9).'</td></tr>
         </tbody></table>
         </td>
         <td valign="top" width="21%">
         <table border="0" cellpadding="2" cellspacing="0" width="100%">
    <tbody><tr><td align="left" style="COLOR:#000000;font-size:12px;"><b>Ultimele cautari</b></td></tr>
    <tr><td>'
    .Cuv(9).'</td></tr>
         </tbody></table>
         </td>
         </tr></tbody>
         </table>
         </tr></table>
    </td>
         <!--top_ads_eof-->
    </tr>
    <tr>
         <td valign="top" width="80%">
         <!--Search_results-->
         '
    .$results_html.'
         <!--Search_results_eof-->
         </td>
         <!--side_ads-->
         <td valign="top">
         <table border="0" cellpadding="0" cellspacing="0">
         <tr>
         <td align="center">
         <span style="FONT-SIZE: 10px; COLOR: #666666; FONT-FAMILY: arial">PENTRU TINE</span>
         </td>
         </tr>
         <tr>
         <td align="left">
         <div style="padding-top:5px">
         <table border="0" width="188" bgcolor="#f8fff5" style="border: 1px; border-style: solid; border-color: #b6dff6"><tr>
         <td style="padding-top:10px;padding-left:10px;padding-bottom:10px;padding-right:10px;">
         <center><span style="FONT-SIZE: 10px; COLOR: #666666; FONT-FAMILY: arial"><b><font color="#FF0000">Mobile Mania</FONT></b></span></center><Br>
         <img src=http://www.bestweb.ro/punct.gif border=0 width=180 height=0><br>
         <center>
         <a href="http://sms.bestweb.ro"><img src="http://sms.bestweb.ro/promo/all.gif" border="0"></a>&nbsp;
         </center>
         </td>
         </tr>
         </table>
         </div>
         <div style="padding-top:5px">
         <table border="0" width="188" bgcolor="#f8fff5" style="border: 1px; border-style: solid; border-color: #b6dff6"><tr>
         <td style="padding-top:10px;padding-left:10px;padding-bottom:10px;padding-right:10px;">
         <img src=http://www.bestweb.ro/punct.gif border=0 width=180 height=0><br>
         <center>
         <!-- affiliate code -->
         <script language=javascript src=http://ads.neogen.ro/affiliates/ads.php?VERTI%0D%10></script>
         <!-- end affiliate code -->
         </center>
         </td>
         </tr>
         </table>
         </div>
         <div style="padding-top:5px">
         <table border="0" width="188" bgcolor="#f8fff5" style="border: 1px; border-style: solid; border-color: #b6dff6"><tr>
         <td style="padding-top:10px;padding-left:10px;padding-bottom:10px;padding-right:10px;"><center>
         <span style="FONT-SIZE: 10px; COLOR: #666666; FONT-FAMILY: arial"><b>Cautari asemanatoare</b></span></center><br>
         <img src=http://www.bestweb.ro/punct.gif border=0 width=180 height=0><br>
         <center>'
    ;
    //INSERT STARTS HERE
    $keywords explode("+""motru+film");
    if (
    $keywords[0] != NULL){
    $query "SELECT * FROM ro_terms WHERE keyword LIKE '%".$keywords[0]."%'";
    for (
    $i=1;$i<count($keywords);$i++){
    $query.= " OR keyword LIKE '%".$keywords[$i]."%'";
    }
    $query .= ' LIMIT 20';
    }
    $result = @mysql_query($query) or die(mysql_error());
    if(
    mysql_num_rows($result)){
    while(
    $row mysql_fetch_assoc($result)){
    $cuvant $row['keyword'];
    $cuvant str_replace("+"" "$cuvant);
    content .= '<font size="2"><a href="http://cauta.bestweb.ro/'.$row['type'].'_'.$row['keyword'].'.html">'.$cuvant.'</a></font><br>';
    }
    }else{
    content .= 'Nu exista cautari similare!';
    }
    //INSERT FINISHES HERE
         
    content .='
         </center>
    </td>
    </tr>
    </table>
    </div><div style="padding-top:5px">
    <table border="0" width="188" bgcolor="#f8fff5" style="border: 1px; border-style: solid; border-color: #b6dff6"><tr>
    <td style="padding-top:10px;padding-left:10px;padding-bottom:10px;padding-right:10px;"><center>
    <span style="FONT-SIZE: 10px; COLOR: #666666; FONT-FAMILY: arial"><b>Top cautari</b></span></center><br>
    <img src=http://www.bestweb.ro/punct.gif border=0 width=180 height=0><br>
    <center>'
    .showLastTop(15).'</center>
    </td>
    </tr>
    </table>
    </div>
    <div style="padding-top:5px">
    <table border="0" width="188" bgcolor="#f8fff5" style="border: 1px; border-style: solid; border-color: #b6dff6"><tr>
    <td style="padding-top:10px;padding-left:10px;padding-bottom:10px;padding-right:10px;"><center>
    <span style="FONT-SIZE: 10px; COLOR: #666666; FONT-FAMILY: arial"><b>Ultimele programe adaugate</b></span></center><br>
    <img src=http://www.bestweb.ro/punct.gif border=0 width=180 height=0><br>
    <center>'
    .showLastdown(15).'</center>
    </td>
    </tr>
    </table>
    </div>
    </div>
    </td></tr>
    </table>
    </td>
    <!--side_ads_eof-->
    </tr>
         <tr>
    <!--bottom_ads-->
    <td align="left" colspan="2">
    <table border="0" width="100%" bgcolor="#f8fff5" style="border: 1px; border-style: solid; border-color: #b6dff6">
    <tr>
    <td align="left">Ultimile cautari:&nbsp;
    '
    .showLast(3).'
    <td width="150" valign="top" align="RIGHT"><span style="FONT-SIZE: 10px; COLOR: #666666; FONT-FAMILY: arial">CAUTARI</span></td></tr></table>
         </td>
         <!--bottom_ads_eof-->
         </tr>
    </table>
    <br>
    <form method="get">
    <DIV class="searchBarbottom">
    <TABLE cellSpacing=0 cellPadding=0 border=0 width="100%" height="40">
    <TR>
    <TD align=center>
    <SPAN class=query>
    <INPUT maxLength=200 size=40 name=search value="'
    .$parsed_keywords.'">
    <INPUT type=submit value=" Search ">
    <INPUT type=hidden value="'
    .$type.'" name="type">
    </SPAN>
    </TD>
    </TR>
    </TABLE>
    </div>
    </form>'
    ;
        if (
    $_settings->is_cache_used() && ($result === FALSE)){
         
    add_data_to_cache($_SERVER['QUERY_STRING'],$content,$_settings->get_cache_time(),$_settings->get_cache_size());
        }
    }else{
        
    $content $result;
    }
    }
    $titlu '
    <HTML>
    <HEAD>
    <TITLE>cauta.BestWeb.ro '
    .$parsed_keywords.'</TITLE>';
    echo 
    $titlu;
    echo 
    $_settings->get_header();
    echo 
    $content;
    echo 
    $_settings->get_footer();
    ?>
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

  12. #12
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Bucharest
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi!
    The intial php code (the page) work 100% corect .. is a web search...

    I think the aditional code is not placed good.. not work.. It display me a white page..

  13. #13
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,485
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sosoro
    Hi!
    The intial php code (the page) work 100% corect .. is a web search...

    I think the aditional code is not placed good.. not work.. It display me a white page..
    Try this code below and tell me what you get ?

    PHP Code:
    <?
    include("main_inc.php");
    include(
    "ettings_class.php");
    include(
    "pager_class.php");
    include(
    "includes/ads.php");
    include(
    "last_s.php");
    include(
    "last_dreapta.php");
    include(
    "last_download.php");
    include(
    "last_top.php");
    include(
    "last_extra.php");
    db_connect();
    $_settings = new Settings();
    $search_cats = array('web'=>'Web','news'=>'Stiri','images'=>'Poze','video'=>'Video','audio'=>'Audio','shopping'=>'Shopping');
    //array('web'=>'Web','news'=>'News','images'=>'Pictures','video'=>'Video','audio'=>'Audio','shopping'=>'Shopping');
    $type = isset($_GET['type']) ? $_GET['type'] : 'web';
    $keywords = isset($_GET['search']) ? $_GET['search'] : '';
    $parsed_keywords htmlspecialchars(chop($keywords));
    $prepared_keywords str_replace(" ","+",chop($keywords));
    $tabs "";
    if (
    $type == 'compare'){
    $old_type $type;
    $type 'shopping';
    }else
    $old_type $type;
    foreach(
    $search_cats as $search_type=>$display_name){
        if (
    $search_type == $type){
         
    $tabs .= '';
        }else{
         
    $tabs .= '';
        }
    }
    if ((
    strlen(chop($keywords)) == 0)){
        
    $content '
    <table width="100%" cellSpacing=0 cellPadding=0>
        <tr><td align="center">
        <SPAN class=tabSpace></SPAN><A class=tabOn href="http://www.bestweb.ro">Home</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://chat.bestweb.ro">Chat</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://www.bestweb.ro/get">Download</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://forum.bestweb.ro">Forum</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://sms.bestweb.ro">SMS & GSM</A><SPAN class=tabSpace></SPAN>
        </td></tr></table>
        <DIV class="searchBar2">
        <TABLE cellSpacing=0 cellPadding=0 border=0 width="100%" height="70">
        <TR>
        <TD align=center>
        <SPAN class=query>
        <form name="searchform" onSubmit="return dosearch();">
        <input type="text" name="searchterms" value="'
    .$parsed_keywords.'">
        <select name="sengines">
        <option value="http://www.bestweb.ro/get/cauta.html?query=" selected>in Download</option>
        <option value="http://cauta.bestweb.ro/?type=shopping&search=" selected>in Shopping</option>
        <option value="http://cauta.bestweb.ro/?type=news&search=" selected>in Stiri</option>
        <option value="http://cauta.bestweb.ro/?type=images&search=" selected>in Poze</option>
        <option value="http://cauta.bestweb.ro/?type=video&search=" selected>in Video</option>
        <option value="http://cauta.bestweb.ro/?type=audio&search=" selected>in Audio</option>
        <option value="http://cauta.bestweb.ro/?type=web&search=" selected>pe Web</option>
        '
    .$tabs.'
        </select>
        <input type="submit" name="SearchSubmit" value="Search">
        </form>
        </SPAN>
        </TD>
        </TR>
        </TABLE>
        </DIV>
        </form>'
    ;
    }else{
        
    $from_cache FALSE;
        
    add_stat_to_db($prepared_keywords,$type);
        if (
    $_settings->is_cache_used()){
         
    $result check_chache($_SERVER['QUERY_STRING'],$_settings->get_cache_time());
        }else
        
    $result TRUE;
        
    $type $old_type;
        if ((
    $_settings->is_cache_used() && ($result === FALSE)) || ($result === TRUE)){
    switch (
    $type){
         case 
    'web':{
         include(
    "includes/classes/web_search_class.php");
         
    $results = new WebSearch($_settings,$prepared_keywords);
         
    $results_html $results->get_results();
         
    $total_found_string $results->m_total_found_string;
         }break;
         case 
    'news':{
         include(
    "includes/classes/news_search_class.php");
         
    $results = new NewsSearch($_settings,$prepared_keywords);
         
    $results_html $results->get_results();
         
    $total_found_string $results->m_total_found_string;
         }break;
         case 
    'images':{
         include(
    "includes/classes/images_search_class.php");
         
    $results = new ImagesSearch($_settings,$prepared_keywords);
         
    $results_html $results->get_results();
         
    $total_found_string $results->m_total_found_string;
         }break;
         case 
    'video':{
         include(
    "includes/classes/video_search_class.php");
         
    $results = new VideoSearch($_settings,$prepared_keywords);
         
    $results_html $results->get_results();
         
    $total_found_string $results->m_total_found_string;
         }break;
         case 
    'audio':{
         include(
    "includes/classes/audio_search_class.php");
         
    $results = new AudioSearch($_settings,$prepared_keywords);
         
    $results_html $results->get_results();
         
    $total_found_string $results->m_total_found_string;
         }break;
         case 
    'shopping':{
         include(
    "includes/classes/shopping_search_class.php");
         
    $results = new ShoppingSearch($_settings,$prepared_keywords);
         
    $results_html $results->get_results();
         
    $total_found_string $results->m_total_found_string;
         }break;
         case 
    'compare':{
         include(
    "includes/classes/compare_shopping_search_class.php");
         
    $results = new CompareShoppingSearch($_settings,$prepared_keywords);
         
    $results_html $results->get_results();
         
    $total_found_string $results->m_total_found_string;
         }break;
    }
    $adsp = isset($_GET['pos']) ? $_GET['pos'] : 1;
    $top_ads get_ads('top',$prepared_keywords,$adsp);
    $side_ads get_ads('side',$prepared_keywords,$adsp);
    $bottom_ads get_ads('bottom',$prepared_keywords,$adsp);
    if (
    $type == 'compare')
         
    $type 'shopping';
    $content '
    <table width="100%" cellSpacing=0 cellPadding=0>
         <tr><td align="center">
         <SPAN class=tabSpace></SPAN><A class=tabOn href="http://www.bestweb.ro">Home</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://chat.bestweb.ro">Chat</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://www.bestweb.ro/get">Download</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://forum.bestweb.ro">Forum</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://sms.bestweb.ro">SMS & GSM</A><SPAN class=tabSpace></SPAN>
         </td></tr></table>
         <DIV class="searchBar2">
         <TABLE cellSpacing=0 cellPadding=0 border=0 width="100%" height="70">
         <TR>
         <TD align=center>
         <SPAN class=query>
         <form name="searchform" onSubmit="return dosearch();">
         <input type="text" name="searchterms" value="'
    .$parsed_keywords.'">
         <select name="sengines">
         <option value="http://www.bestweb.ro/get/cauta.html?query=" selected>in Download</option>
         <option value="http://cauta.bestweb.ro/?type=shopping&search=" selected>in Shopping</option>
         <option value="http://cauta.bestweb.ro/?type=news&search=" selected>in Stiri</option>
         <option value="http://cauta.bestweb.ro/?type=images&search=" selected>in Poze</option>
         <option value="http://cauta.bestweb.ro/?type=video&search=" selected>in Video</option>
         <option value="http://cauta.bestweb.ro/?type=audio&search=" selected>in Audio</option>
         <option value="http://cauta.bestweb.ro/?type=web&search=" selected>pe Web</option>
         '
    .$tabs.'
         </select>
         <input type="submit" name="SearchSubmit" value="Search">
         </form>
         </SPAN>
         </TD>
         </TR>
         </TABLE>
         </DIV>
         </form>
         <DIV class=resultHeading>
         <TABLE cellSpacing=0 cellPadding=0 width="100%" border="0">
    <TR>
         <TD class=inf align="right">
         '
    .$total_found_string.'
         </TD>
    </TR>
    </TABLE>
    </DIV>
    <table width="100%" border="0">
    <tr>
         <!--top_ads-->
         <td align="left" colspan="2">
         <table border="0" width="100%" bgcolor="#f8fff5" style="border: 1px; border-style: solid; border-color: #b6dff6">
         <tr>
         <td align="left">
         <table border="0" cellpadding="5" cellspacing="0" width="100%" bgcolor="#F8FFF5" bordercolor="#111111">
         <tbody><tr>
         <td valign="top" width="47%">
         <table border="0" cellpadding="2" cellspacing="0" width="100%">
         <tbody><tr><td align="left" style="COLOR:#000000;font-size:12px;"><b>Ultimele topicuri pe forum</b></td></tr>
    <tr><td>'
    .To(9).'</td></tr>
         </tbody></table>
         </td>
         <td valign="top" width="32%">
         <table border="0" cellpadding="2" cellspacing="0" width="100%">
    <tbody><tr><td align="left" style="COLOR:#000000;font-size:12px;"><b>Ultimele programe adaugate</b></td></tr>
    <tr><td>'
    .Dow(9).'</td></tr>
         </tbody></table>
         </td>
         <td valign="top" width="21%">
         <table border="0" cellpadding="2" cellspacing="0" width="100%">
    <tbody><tr><td align="left" style="COLOR:#000000;font-size:12px;"><b>Ultimele cautari</b></td></tr>
    <tr><td>'
    .Cuv(9).'</td></tr>
         </tbody></table>
         </td>
         </tr></tbody>
         </table>
         </tr></table>
    </td>
         <!--top_ads_eof-->
    </tr>
    <tr>
         <td valign="top" width="80%">
         <!--Search_results-->
         '
    .$results_html.'
         <!--Search_results_eof-->
         </td>
         <!--side_ads-->
         <td valign="top">
         <table border="0" cellpadding="0" cellspacing="0">
         <tr>
         <td align="center">
         <span style="FONT-SIZE: 10px; COLOR: #666666; FONT-FAMILY: arial">PENTRU TINE</span>
         </td>
         </tr>
         <tr>
         <td align="left">
         <div style="padding-top:5px">
         <table border="0" width="188" bgcolor="#f8fff5" style="border: 1px; border-style: solid; border-color: #b6dff6"><tr>
         <td style="padding-top:10px;padding-left:10px;padding-bottom:10px;padding-right:10px;">
         <center><span style="FONT-SIZE: 10px; COLOR: #666666; FONT-FAMILY: arial"><b><font color="#FF0000">Mobile Mania</FONT></b></span></center><Br>
         <img src=http://www.bestweb.ro/punct.gif border=0 width=180 height=0><br>
         <center>
         <a href="http://sms.bestweb.ro"><img src="http://sms.bestweb.ro/promo/all.gif" border="0"></a>&nbsp;
         </center>
         </td>
         </tr>
         </table>
         </div>
         <div style="padding-top:5px">
         <table border="0" width="188" bgcolor="#f8fff5" style="border: 1px; border-style: solid; border-color: #b6dff6"><tr>
         <td style="padding-top:10px;padding-left:10px;padding-bottom:10px;padding-right:10px;">
         <img src=http://www.bestweb.ro/punct.gif border=0 width=180 height=0><br>
         <center>
         <!-- affiliate code -->
         <script language=javascript src=http://ads.neogen.ro/affiliates/ads.php?VERTI%0D%10></script>
         <!-- end affiliate code -->
         </center>
         </td>
         </tr>
         </table>
         </div>
         <div style="padding-top:5px">
         <table border="0" width="188" bgcolor="#f8fff5" style="border: 1px; border-style: solid; border-color: #b6dff6"><tr>
         <td style="padding-top:10px;padding-left:10px;padding-bottom:10px;padding-right:10px;"><center>
         <span style="FONT-SIZE: 10px; COLOR: #666666; FONT-FAMILY: arial"><b>Cautari asemanatoare</b></span></center><br>
         <img src=http://www.bestweb.ro/punct.gif border=0 width=180 height=0><br>
         <center>'
    ;
         
    content .='
         </center>
    </td>
    </tr>
    </table>
    </div><div style="padding-top:5px">
    <table border="0" width="188" bgcolor="#f8fff5" style="border: 1px; border-style: solid; border-color: #b6dff6"><tr>
    <td style="padding-top:10px;padding-left:10px;padding-bottom:10px;padding-right:10px;"><center>
    <span style="FONT-SIZE: 10px; COLOR: #666666; FONT-FAMILY: arial"><b>Top cautari</b></span></center><br>
    <img src=http://www.bestweb.ro/punct.gif border=0 width=180 height=0><br>
    <center>'
    .showLastTop(15).'</center>
    </td>
    </tr>
    </table>
    </div>
    <div style="padding-top:5px">
    <table border="0" width="188" bgcolor="#f8fff5" style="border: 1px; border-style: solid; border-color: #b6dff6"><tr>
    <td style="padding-top:10px;padding-left:10px;padding-bottom:10px;padding-right:10px;"><center>
    <span style="FONT-SIZE: 10px; COLOR: #666666; FONT-FAMILY: arial"><b>Ultimele programe adaugate</b></span></center><br>
    <img src=http://www.bestweb.ro/punct.gif border=0 width=180 height=0><br>
    <center>'
    .showLastdown(15).'</center>
    </td>
    </tr>
    </table>
    </div>
    </div>
    </td></tr>
    </table>
    </td>
    <!--side_ads_eof-->
    </tr>
         <tr>
    <!--bottom_ads-->
    <td align="left" colspan="2">
    <table border="0" width="100%" bgcolor="#f8fff5" style="border: 1px; border-style: solid; border-color: #b6dff6">
    <tr>
    <td align="left">Ultimile cautari:&nbsp;
    '
    .showLast(3).'
    <td width="150" valign="top" align="RIGHT"><span style="FONT-SIZE: 10px; COLOR: #666666; FONT-FAMILY: arial">CAUTARI</span></td></tr></table>
         </td>
         <!--bottom_ads_eof-->
         </tr>
    </table>
    <br>
    <form method="get">
    <DIV class="searchBarbottom">
    <TABLE cellSpacing=0 cellPadding=0 border=0 width="100%" height="40">
    <TR>
    <TD align=center>
    <SPAN class=query>
    <INPUT maxLength=200 size=40 name=search value="'
    .$parsed_keywords.'">
    <INPUT type=submit value=" Search ">
    <INPUT type=hidden value="'
    .$type.'" name="type">
    </SPAN>
    </TD>
    </TR>
    </TABLE>
    </div>
    </form>'
    ;
        if (
    $_settings->is_cache_used() && ($result === FALSE)){
         
    add_data_to_cache($_SERVER['QUERY_STRING'],$content,$_settings->get_cache_time(),$_settings->get_cache_size());
        }
    }else{
        
    $content $result;
    }
    }
    $titlu '
    <HTML>
    <HEAD>
    <TITLE>cauta.BestWeb.ro '
    .$parsed_keywords.'</TITLE>';
    echo 
    $titlu;
    echo 
    $_settings->get_header();
    echo 
    $content;
    echo 
    $_settings->get_footer();
    ?>
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

  14. #14
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Bucharest
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The same..a blank page!

    But remeber..the original code is work 100% ok!

  15. #15
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,485
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sosoro
    The same..a blank page!

    But remeber..the original code is work 100% ok!
    But all I've done is send you back your original code !!!!!!!!!

    I just removed the bits I'd inserted, and posted the code here ?

    The link to your original code has disappeard, send me the original code again.
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

  16. #16
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Bucharest
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  17. #17
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,485
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Try this
    PHP Code:
    <?
    include("main_inc.php");
    include(
    "ettings_class.php");
    include(
    "pager_class.php");
    include(
    "includes/ads.php");
    include(
    "last_s.php");
    include(
    "last_dreapta.php");
    include(
    "last_download.php");
    include(
    "last_top.php");
    include(
    "last_extra.php");
    db_connect();
    $_settings = new Settings();
    $search_cats = array('web'=>'Web','news'=>'Stiri','images'=>'Poze','video'=>'Video','audio'=>'Audio','shopping'=>'Shopping');
    //array('web'=>'Web','news'=>'News','images'=>'Pictures','video'=>'Video','audio'=>'Audio','shopping'=>'Shopping');
    $type = isset($_GET['type']) ? $_GET['type'] : 'web';
    $keywords = isset($_GET['search']) ? $_GET['search'] : '';
    $parsed_keywords htmlspecialchars(chop($keywords));
    $prepared_keywords str_replace(" ","+",chop($keywords));
    $tabs "";
    if (
    $type == 'compare'){
    $old_type $type;
    $type 'shopping';
    }else
    $old_type $type;
    foreach(
    $search_cats as $search_type=>$display_name){
        if (
    $search_type == $type){
         
    $tabs .= '';
        }else{
         
    $tabs .= '';
        }
    }
    if ((
    strlen(chop($keywords)) == 0)){
        
    $content '
    <table width="100%" cellSpacing=0 cellPadding=0>
        <tr><td align="center">
        <SPAN class=tabSpace></SPAN><A class=tabOn href="http://www.bestweb.ro">Home</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://chat.bestweb.ro">Chat</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://www.bestweb.ro/get">Download</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://forum.bestweb.ro">Forum</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://sms.bestweb.ro">SMS & GSM</A><SPAN class=tabSpace></SPAN>
        </td></tr></table>
        <DIV class="searchBar2">
        <TABLE cellSpacing=0 cellPadding=0 border=0 width="100%" height="70">
        <TR>
        <TD align=center>
        <SPAN class=query>
        <form name="searchform" onSubmit="return dosearch();">
        <input type="text" name="searchterms" value="'
    .$parsed_keywords.'">
        <select name="sengines">
        <option value="http://www.bestweb.ro/get/cauta.html?query=" selected>in Download</option>
        <option value="http://cauta.bestweb.ro/?type=shopping&search=" selected>in Shopping</option>
        <option value="http://cauta.bestweb.ro/?type=news&search=" selected>in Stiri</option>
        <option value="http://cauta.bestweb.ro/?type=images&search=" selected>in Poze</option>
        <option value="http://cauta.bestweb.ro/?type=video&search=" selected>in Video</option>
        <option value="http://cauta.bestweb.ro/?type=audio&search=" selected>in Audio</option>
        <option value="http://cauta.bestweb.ro/?type=web&search=" selected>pe Web</option>
        '
    .$tabs.'
        </select>
        <input type="submit" name="SearchSubmit" value="Search">
        </form>
        </SPAN>
        </TD>
        </TR>
        </TABLE>
        </DIV>
        </form>'
    ;
    }else{
        
    $from_cache FALSE;
        
    add_stat_to_db($prepared_keywords,$type);
        if (
    $_settings->is_cache_used()){
         
    $result check_chache($_SERVER['QUERY_STRING'],$_settings->get_cache_time());
        }else
        
    $result TRUE;
        
    $type $old_type;
        if ((
    $_settings->is_cache_used() && ($result === FALSE)) || ($result === TRUE)){
    switch (
    $type){
         case 
    'web':{
         include(
    "includes/classes/web_search_class.php");
         
    $results = new WebSearch($_settings,$prepared_keywords);
         
    $results_html $results->get_results();
         
    $total_found_string $results->m_total_found_string;
         }break;
         case 
    'news':{
         include(
    "includes/classes/news_search_class.php");
         
    $results = new NewsSearch($_settings,$prepared_keywords);
         
    $results_html $results->get_results();
         
    $total_found_string $results->m_total_found_string;
         }break;
         case 
    'images':{
         include(
    "includes/classes/images_search_class.php");
         
    $results = new ImagesSearch($_settings,$prepared_keywords);
         
    $results_html $results->get_results();
         
    $total_found_string $results->m_total_found_string;
         }break;
         case 
    'video':{
         include(
    "includes/classes/video_search_class.php");
         
    $results = new VideoSearch($_settings,$prepared_keywords);
         
    $results_html $results->get_results();
         
    $total_found_string $results->m_total_found_string;
         }break;
         case 
    'audio':{
         include(
    "includes/classes/audio_search_class.php");
         
    $results = new AudioSearch($_settings,$prepared_keywords);
         
    $results_html $results->get_results();
         
    $total_found_string $results->m_total_found_string;
         }break;
         case 
    'shopping':{
         include(
    "includes/classes/shopping_search_class.php");
         
    $results = new ShoppingSearch($_settings,$prepared_keywords);
         
    $results_html $results->get_results();
         
    $total_found_string $results->m_total_found_string;
         }break;
         case 
    'compare':{
         include(
    "includes/classes/compare_shopping_search_class.php");
         
    $results = new CompareShoppingSearch($_settings,$prepared_keywords);
         
    $results_html $results->get_results();
         
    $total_found_string $results->m_total_found_string;
         }break;
    }
    $adsp = isset($_GET['pos']) ? $_GET['pos'] : 1;
    $top_ads get_ads('top',$prepared_keywords,$adsp);
    $side_ads get_ads('side',$prepared_keywords,$adsp);
    $bottom_ads get_ads('bottom',$prepared_keywords,$adsp);
    if (
    $type == 'compare')
         
    $type 'shopping';
    $content '
    <table width="100%" cellSpacing=0 cellPadding=0>
         <tr><td align="center">
         <SPAN class=tabSpace></SPAN><A class=tabOn href="http://www.bestweb.ro">Home</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://chat.bestweb.ro">Chat</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://www.bestweb.ro/get">Download</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://forum.bestweb.ro">Forum</A><SPAN class=tabSpace></SPAN><A class=tabOff href="http://sms.bestweb.ro">SMS & GSM</A><SPAN class=tabSpace></SPAN>
         </td></tr></table>
         <DIV class="searchBar2">
         <TABLE cellSpacing=0 cellPadding=0 border=0 width="100%" height="70">
         <TR>
         <TD align=center>
         <SPAN class=query>
         <form name="searchform" onSubmit="return dosearch();">
         <input type="text" name="searchterms" value="'
    .$parsed_keywords.'">
         <select name="sengines">
         <option value="http://www.bestweb.ro/get/cauta.html?query=" selected>in Download</option>
         <option value="http://cauta.bestweb.ro/?type=shopping&search=" selected>in Shopping</option>
         <option value="http://cauta.bestweb.ro/?type=news&search=" selected>in Stiri</option>
         <option value="http://cauta.bestweb.ro/?type=images&search=" selected>in Poze</option>
         <option value="http://cauta.bestweb.ro/?type=video&search=" selected>in Video</option>
         <option value="http://cauta.bestweb.ro/?type=audio&search=" selected>in Audio</option>
         <option value="http://cauta.bestweb.ro/?type=web&search=" selected>pe Web</option>
         '
    .$tabs.'
         </select>
         <input type="submit" name="SearchSubmit" value="Search">
         </form>
         </SPAN>
         </TD>
         </TR>
         </TABLE>
         </DIV>
         </form>
         <DIV class=resultHeading>
         <TABLE cellSpacing=0 cellPadding=0 width="100%" border="0">
    <TR>
         <TD class=inf align="right">
         '
    .$total_found_string.'
         </TD>
    </TR>
    </TABLE>
    </DIV>
    <table width="100%" border="0">
    <tr>
         <!--top_ads-->
         <td align="left" colspan="2">
         <table border="0" width="100%" bgcolor="#f8fff5" style="border: 1px; border-style: solid; border-color: #b6dff6">
         <tr>
         <td align="left">
         <table border="0" cellpadding="5" cellspacing="0" width="100%" bgcolor="#F8FFF5" bordercolor="#111111">
         <tbody><tr>
         <td valign="top" width="47%">
         <table border="0" cellpadding="2" cellspacing="0" width="100%">
         <tbody><tr><td align="left" style="COLOR:#000000;font-size:12px;"><b>Ultimele topicuri pe forum</b></td></tr>
    <tr><td>'
    .To(9).'</td></tr>
         </tbody></table>
         </td>
         <td valign="top" width="32%">
         <table border="0" cellpadding="2" cellspacing="0" width="100%">
    <tbody><tr><td align="left" style="COLOR:#000000;font-size:12px;"><b>Ultimele programe adaugate</b></td></tr>
    <tr><td>'
    .Dow(9).'</td></tr>
         </tbody></table>
         </td>
         <td valign="top" width="21%">
         <table border="0" cellpadding="2" cellspacing="0" width="100%">
    <tbody><tr><td align="left" style="COLOR:#000000;font-size:12px;"><b>Ultimele cautari</b></td></tr>
    <tr><td>'
    .Cuv(9).'</td></tr>
         </tbody></table>
         </td>
         </tr></tbody>
         </table>
         </tr></table>
    </td>
         <!--top_ads_eof-->
    </tr>
    <tr>
         <td valign="top" width="80%">
         <!--Search_results-->
         '
    .$results_html.'
         <!--Search_results_eof-->
         </td>
         <!--side_ads-->
         <td valign="top">
         <table border="0" cellpadding="0" cellspacing="0">
         <tr>
         <td align="center">
         <span style="FONT-SIZE: 10px; COLOR: #666666; FONT-FAMILY: arial">PENTRU TINE</span>
         </td>
         </tr>
         <tr>
         <td align="left">
         <div style="padding-top:5px">
         <table border="0" width="188" bgcolor="#f8fff5" style="border: 1px; border-style: solid; border-color: #b6dff6"><tr>
         <td style="padding-top:10px;padding-left:10px;padding-bottom:10px;padding-right:10px;">
         <center><span style="FONT-SIZE: 10px; COLOR: #666666; FONT-FAMILY: arial"><b><font color="#FF0000">Mobile Mania</FONT></b></span></center><Br>
         <img src=http://www.bestweb.ro/punct.gif border=0 width=180 height=0><br>
         <center>
         <a href="http://sms.bestweb.ro"><img src="http://sms.bestweb.ro/promo/all.gif" border="0"></a>&nbsp;
         </center>
         </td>
         </tr>
         </table>
         </div>
         <div style="padding-top:5px">
         <table border="0" width="188" bgcolor="#f8fff5" style="border: 1px; border-style: solid; border-color: #b6dff6"><tr>
         <td style="padding-top:10px;padding-left:10px;padding-bottom:10px;padding-right:10px;">
         <img src=http://www.bestweb.ro/punct.gif border=0 width=180 height=0><br>
         <center>
         <!-- affiliate code -->
         <script language=javascript src=http://ads.neogen.ro/affiliates/ads.php?VERTI%0D%10></script>
         <!-- end affiliate code -->
         </center>
         </td>
         </tr>
         </table>
         </div>
         <div style="padding-top:5px">
         <table border="0" width="188" bgcolor="#f8fff5" style="border: 1px; border-style: solid; border-color: #b6dff6"><tr>
         <td style="padding-top:10px;padding-left:10px;padding-bottom:10px;padding-right:10px;"><center>
         <span style="FONT-SIZE: 10px; COLOR: #666666; FONT-FAMILY: arial"><b>Cautari asemanatoare</b></span></center><br>
         <img src=http://www.bestweb.ro/punct.gif border=0 width=180 height=0><br>
         <center>'
    ;
    //INSERT STARTS HERE
    $keywords explode("+""motru+film");
    if (
    $keywords[0] != NULL){
    $query "SELECT * FROM ro_terms WHERE keyword LIKE '%".$keywords[0]."%'";
    for (
    $i=1;$i<count($keywords);$i++){
    $query.= " OR keyword LIKE '%".$keywords[$i]."%'";
    }
    $query .= ' LIMIT 20';
    }
    $result = @mysql_query($query) or die(mysql_error());
    if(
    mysql_num_rows($result)){
    while(
    $row mysql_fetch_assoc($result)){
    $cuvant $row['keyword'];
    $cuvant str_replace("+"" "$cuvant);
    $content .= '<font size="2"><a href="http://cauta.bestweb.ro/'.$row['type'].'_'.$row['keyword'].'.html">'.$cuvant.'</a></font><br>';
    }
    }else{
    $content .= 'Nu exista cautari similare!';
    }
    //INSERT FINISHES HERE
         
    $content .='
         </center>
    </td>
    </tr>
    </table>
    </div><div style="padding-top:5px">
    <table border="0" width="188" bgcolor="#f8fff5" style="border: 1px; border-style: solid; border-color: #b6dff6"><tr>
    <td style="padding-top:10px;padding-left:10px;padding-bottom:10px;padding-right:10px;"><center>
    <span style="FONT-SIZE: 10px; COLOR: #666666; FONT-FAMILY: arial"><b>Top cautari</b></span></center><br>
    <img src=http://www.bestweb.ro/punct.gif border=0 width=180 height=0><br>
    <center>'
    .showLastTop(15).'</center>
    </td>
    </tr>
    </table>
    </div>
    <div style="padding-top:5px">
    <table border="0" width="188" bgcolor="#f8fff5" style="border: 1px; border-style: solid; border-color: #b6dff6"><tr>
    <td style="padding-top:10px;padding-left:10px;padding-bottom:10px;padding-right:10px;"><center>
    <span style="FONT-SIZE: 10px; COLOR: #666666; FONT-FAMILY: arial"><b>Ultimele programe adaugate</b></span></center><br>
    <img src=http://www.bestweb.ro/punct.gif border=0 width=180 height=0><br>
    <center>'
    .showLastdown(15).'</center>
    </td>
    </tr>
    </table>
    </div>
    </div>
    </td></tr>
    </table>
    </td>
    <!--side_ads_eof-->
    </tr>
         <tr>
    <!--bottom_ads-->
    <td align="left" colspan="2">
    <table border="0" width="100%" bgcolor="#f8fff5" style="border: 1px; border-style: solid; border-color: #b6dff6">
    <tr>
    <td align="left">Ultimile cautari:&nbsp;
    '
    .showLast(3).'
    <td width="150" valign="top" align="RIGHT"><span style="FONT-SIZE: 10px; COLOR: #666666; FONT-FAMILY: arial">CAUTARI</span></td></tr></table>
         </td>
         <!--bottom_ads_eof-->
         </tr>
    </table>
    <br>
    <form method="get">
    <DIV class="searchBarbottom">
    <TABLE cellSpacing=0 cellPadding=0 border=0 width="100%" height="40">
    <TR>
    <TD align=center>
    <SPAN class=query>
    <INPUT maxLength=200 size=40 name=search value="'
    .$parsed_keywords.'">
    <INPUT type=submit value=" Search ">
    <INPUT type=hidden value="'
    .$type.'" name="type">
    </SPAN>
    </TD>
    </TR>
    </TABLE>
    </div>
    </form>'
    ;
        if (
    $_settings->is_cache_used() && ($result === FALSE)){
         
    add_data_to_cache($_SERVER['QUERY_STRING'],$content,$_settings->get_cache_time(),$_settings->get_cache_size());
        }
    }else{
        
    $content $result;
    }
    }
    $titlu '
    <HTML>
    <HEAD>
    <TITLE>cauta.BestWeb.ro '
    .$parsed_keywords.'</TITLE>';
    echo 
    $titlu;
    echo 
    $_settings->get_header();
    echo 
    $content;
    echo 
    $_settings->get_footer();
    ?>
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

  18. #18
    SitePoint Enthusiast
    Join Date
    Jan 2004
    Location
    Rotterdam
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're getting blank pages, you have one problem that you need to solve before anything else. You need to turn on display of errors, otherwise you'll never know what it is exactly that is not working. You cannot debug like that.

    Open your php.ini file and go to the section on Error handling. You should set the "display_errors" property to "on":

    display_errors = On

    Perhaps this will help you to describe more clearly what it is that is going wrong.

  19. #19
    SitePoint Zealot swiftone's Avatar
    Join Date
    Mar 2005
    Location
    Sunny Florida
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your error reporting in your php.ini is probably set to 'off', and you should also set the reporting level to:

    error_reporting = E_ALL

    This will show you every error and notice.

    However, if you are in a production environment make sure to turn the error reporting back to 'off' after you figure out what is wrong.
    Happy Coding,
    Swiftone

    Unique Web Sites

  20. #20
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Bucharest
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mandes still don't work ... The same blank page

    I don't have acces to php.ini on my webhost!

  21. #21
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Bucharest
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So...how can i transfor this code:

    <?php
    // Connect to and select database
    mysql_connect('localhost', '', '');
    mysql_select_db('');

    $keywords = explode("+", "motru+film");

    if ($keywords[0] != NULL)
    {
    $query = "SELECT * FROM ro_terms WHERE keyword LIKE '%".$keywords[0]."%'";

    for ($i=1;$i<count($keywords);$i++)
    {
    $query.= " OR keyword LIKE '%".$keywords[$i]."%'";
    }
    $query .= ' LIMIT 20';
    }

    $result = @mysql_query($query) or die(mysql_error());
    if(mysql_num_rows($result))
    {
    while($row = mysql_fetch_assoc($result))
    {
    $cuvant = $row['keyword'];
    $cuvant = str_replace("+", " ", $cuvant);
    echo = '<font size="2"><a href="http://cauta.bestweb.ro/'.$row['type'].'_'.$row['keyword'].'.html">'.$cuvant.'</a></font><br>';
    }
    }
    else
    {
    echo = 'Nu exista cautari similare!';
    }

    ?>
    into a function?

    Because after that if i call the function in the page will work

    ===================================================
    For example:

    <?php

    // Connect to and select database
    mysql_connect('localhost', 's', 's');
    mysql_select_db('');

    function To($num){
    $display = ''; // Empty the display string
    $query = "SELECT * FROM `forum_topics` ORDER BY `topic_id` DESC LIMIT $num";
    $result = @mysql_query($query);
    if(!$result){
    $display = "No last topics!<br>".mysql_error();
    }
    else
    {
    while($row = mysql_fetch_array($result)){
    $display .= '<a style="COLOR: #0066cc;font-size:12px;" href="http://forum.bestweb.ro/topic'.$row['topic_id'].'.html" title="'.$row['topic_title'].'">'.$row['topic_title'].'</a><br>';
    }
    }

    return $display; // Send the $display varaiable back
    // to the other page.
    }
    ?>
    and if i nlucde the page with that function and i add '.To(9).' will work!

    You understand?

  22. #22
    SitePoint Enthusiast
    Join Date
    Jan 2004
    Location
    Rotterdam
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Assuming your web host will let you use .htaccess files, you can use an .htaccess file with the following in it:

    php_flag display_errors on

    That's the same as setting the previously mentioned property in the php.ini file.

  23. #23
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,485
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sosoro
    Mandes still don't work ... The same blank page

    I don't have acces to php.ini on my webhost!
    All along I've been assuming that the second script you gave me to insert works on it's own, is this the case ?
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

  24. #24
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Bucharest
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok.. display error is on..


    Parse error: parse error, unexpected T_VARIABLE in index3.php on line 240

    And the line 240 is:
    $keywords = explode("+", "cool+film");

  25. #25
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,485
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I dont think the problem is in that line, but in the line before, ensure that you have the functions To(9), Dow(9) and Cuv(9) included in the script.

    Try taking these functions out of the line, see what happens then.
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •