N
N
Nick19922020-04-23 20:28:38
Yandex maps
Nick1992, 2020-04-23 20:28:38

How to set up Yandex maps on the site?

Hello, I am setting up the CNC URL for links on the site www.diesel-serv.ru/main, I have set up part of the links of the main menu, but the question is that when programming the menu item contacts, I get a NOT FOUND entry in the place where the cards are located. Help me figure this out?
This is the contact page code.

<?
    $sql = "select * from page where id=".$page_id;
    $result = mysql_query($sql);
    $row = mysql_fetch_array($result);
   
    $row['text']= ereg_replace("\n", "</p><p>", $row['text']);
?>
 
<?
    $sql = "select * from contact where page_id=".$page_id;
    $result = mysql_query($sql);
    $row_c = mysql_fetch_array($result);
?>
 
<table cellpadding=0 cellspacing=0 colspan=2 id="page">              
    <?
        if ( ($row['sub'] != 0) && ($row['sub'] != null) )
            {
            ?>
            <tr>
                <td class="right_align">
                    &lt;&lt;&nbsp;<a href="?page_id=<?=$row['sub']?>"><?=get_data_by_col("page", "name", "id", $row['sub'])?></a>
                </td>
            </tr>
            <?}
    ?>
    <tr>
        <td colspan=2>
            <div id="text" width=90%>
                <?
                $file_name = $dir_img.get_data_by_col("page", "img", "id", $page_id).".jpg";
                    if (file_exists($file_name))
                        {?>
                            <img src="img_size.php?img=<?=$file_name?>&w=150&h=150" align="left>
                        <?}
                ?>
                <h1><?=$row['name']?></h1>
                <hr noshade size=1>
               
                <?
                    $sql = "select * from contact where page_id=".$page_id." order by id";
                    $result = mysql_query($sql);
                    $row_c = mysql_fetch_array($result);
                   
                    while ($row_c)
                        {?>
                        <h2><?=$row_c['name']?></h2><br>
                        <? if ( ($row_c['text']!="") && ($row_c['text']!=null) )  
                            {?>
                            <p><?=ereg_replace("\n", "</p><p>", $row_c['text'])?></p><br>                      
                            <?}?>      
                           
                        <? if ( ($row_c['address']!="") && ($row_c['address']!=null) )  
                            {?>
                            <b>Адрес:</b> <?=$row_c['address']?><br>                      
                            <?}?>                              
                        <? if ( ($row_c['phone']!="") && ($row_c['phone']!=null) )  
                            {?>
                            <b>Телефон:</b> <?=$row_c['phone']?><br>
                            <?}?>                          
                        <? if ( ($row_c['fax']!="") && ($row_c['fax']!=null) )  
                            {?>
                            <b>Факс:</b> <?=$row_c['fax']?><br>
                            <?}?>                          
                        <? if ( ($row_c['post']!="") && ($row_c['post']!=null) )  
                            {?>
                            <b>Почта:</b> <?=$row_c['post']?><br>
                            <?}?>
                        <br><br>
                        <? if ( ($row_c['coordinate']!="") && ($row_c['coordinate']!=null) )  
                            {?><b>Карта проезда</b><br>
                                <iframe src="modules/map.php?contact_id=<?=$row_c['id']?>" id="map" scrolling=no frameborder=0></iframe><br><br>
                            <?}?>
                       
                        <?
                        $row_c = mysql_fetch_array($result);
                        }
                ?>
            </div>
        </td>
    </tr>
</table>

This is the card code
<?PHP
    $coordinate = get_data_by_col("element_map", "coordinate", "element_id", $row_element['id']);
    $comment = get_data_by_col("element_map", "map_comment", "element_id", $row_element['id']);
?>
<iframe src="modules/map.php?contact_id=<?=$row_element['id']?>" id="map" scrolling=no frameborder=0></iframe>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2020-04-23
@NeiroNx

Probably there is no "modules/map.php"
if there is a "map.php" code,
then in general it turns out to be complete nonsense - you call an iframe to display another iframe in it,
but since the link is relative, it looks for "modules/modules/map.php"
the result is "not found" - but it's better than a recursive iframe - it will be even more fun there)))

N
Nick1992, 2020-04-23
@Nick1992

There is a map file in the modules folder, but it is empty, in addition, there is a map file in the elements folder, the code of which is presented below

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question