Jump to content

seran128

Members
  • Posts

    38
  • Joined

  • Last visited

    Never

Posts posted by seran128

  1. I am getting this error in my javascript my code where the error is being generated and in red

    the output of this in the bottom of my browser looks like

    javascript: buynow(500 Gold,125.00);

    but when I press on the image i get the error

    missing ) after argument list I believe its needing to have the text wraped in '500 Gold' but I can't figure how do do that in the code below.

    [code]$specials .= "<table width='200' border='0' >
        <tr>
          <td align='center'>" . stripslashes($row['short_description']) . "</td>
    [color=red]<td align='center'><a href='javascript: buynow(". stripslashes($row[title]) .",".$row[real_cost].");'><img src='/images/bnscroll.png' width='40' height='26' align='absmiddle' border='0' /></td>[/color]    </tr>
        <tr>
          <td align='center' colspan='2' ><span class='copy'>...........................................</span></td>
        </tr>
      </table>";[/code]
  2. I have a form that has some radio boxes in it. The user press a button and it send the form content to another site. I need to validate the foam data prior to sending to avaoid javascript errors. I would perfer to do this in the same function but if I have to split it up thats fine as well.

    MY Function is

    function sendform()
    {
     
    var oRad = document.MainForm.SELECT___FRMBB1___1;
        for(var i=0; i<oRad.length; i++) {       
    if(oRad[i].checked) {           
    position1=oRad[i].value;
            }
        }

    var oRad1 = document.MainForm.SELECT___FRMBB1___29;
        for(var i=0; i<oRad1.length; i++) {       
    if(oRad1[i].checked) {           
    header1=oRad1[i].value;
            }
        }


    var name1 = document.MainForm.TEXTBOX___91___FRMBB1___24.value;
    var date1 = document.MainForm.TEXTBOX___95___FRMBB1___27.value;

    var url="http://mtsite.com/index.php"
    url=url+"?topheader="+header1
    url=url+"&position="+position1
    url=url+"&name="+name1
    url=url+"&date="+date1

    window.open(url);

       
    }
  3. The code from phoogle says

    [code]$map->addAddress('210 Doster Ave, Mooresville, NC 28115',"<em>This is another address</em> that is italic");[/code]

    I want to add a description from my database to the end of my string that I am sending to google

    My Code

    [code]$description = "<br>Date:".$row["date"]."<br>Description:".$row["description"];
    echo $description;
    $map->addAddress("$row[address1],$row[city],$row[state] $row[zip],$description");[/code]

    The page returns

    Date:12/8/06
    Description:Fri-Sat 8am-4pm Sun 1pm-4pm call for Directions 850-xxx-xxxx
    Warning: file_get_contents(http://api.local.yahoo.com/MapsService/V1/geocode?appid=YahooDemo&location=2712+Shoni+Dr%2CNavarre%2CFL+32566%2C%3Cbr%3EDate%3A12%2F8%2F06%3Cbr%3EDescription%3AFri-Sat+8am-4pm+Sun+1pm-4pm+call+for+Directions+850-396-5898) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in /home/mysite/public_html/phoogle.php on line 129

  4. I have a page that I need to have the date returned displayed in a table format

    LIke

    $sql="select * from TABLE WHERE RegionID = '$InID' AND active = '1' ORDER BY sort_order";
    echo $sql;
    $result=mysql_query($sql,$connection) or die(mysql_error());

    [table]
    [tr][td]value1[/td][td]value2[/td][td]value3[/td][/tr]
    [tr][td]value4[/td][td]value5[/td][td]value6[/td][/tr]
    [tr][td]value7[/td][td]value8[/td][td]value9[/td][/tr]
    [/table]

    }

    return $tabledata;
    }
  5. Yes all dates are in the future

    The problem is

    in the



    $map->addAddress('$row['address1'],$row['city'],$row['state'] $row['zip']');

    Parse error: syntax error, unexpected T_STRING

    My quotes are messed up
  6. I found a great Google maps API PHP tools but I am having problems getting it to work with my DB. I know the Query works because it has been tested in Navicat

    the link to the tools is
    http://www.system7designs.com/codebase

    I need to pull data from a db ond populate the function like they do below. My code is
    [code=php:0]
      <?
      $sql="select * from gs_location WHERE date > NOW() order by date";
    echo $sql;
    $result=mysql_query($sql,$connection) or die(mysql_error());
    while($row=mysql_fetch_array($result)) { 
      $map->addAddress('$row['address1'],$row['city'],$row['state'] $row['zip']');
    }
    $map->showMap();
      ?>[/code]



    their sample code is

    [code=php:0]<?php /**
    * Showing valid points table/list with Phoogle Maps
    * class developed by Justin Johnson <justinjohnson@system7designs.com>
    */

    require_once 'phoogle.php';

    $map = new PhoogleMap();
    $map->setAPIKey("ABQIAAAA0ksKqHM3yT_xmOPe0DANGRRMlCWGe88WcLmN582t1mFB9gpW6hTvRlzTS-LCJ8nFoD2AGi5vq0X-Yg");
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
      <? $map->printGoogleJS(); ?>
      </head>
      <body>
      <?

      $map->addAddress('208 Dingler Ave, Mooresville, NC 28115');
      $map->addAddress('210 Doster Ave, Mooresville, NC 28115');
      $map->addAddress('300 Dingler Ave, Mooresville, NC 28115');
      $map->showMap();

      ?>
      <h3>The following points are displayed on the map:</h3>
      <h4>(displayed using a table with an id of "my_table")</h4>
      <? $map->showValidPoints("table","my_table"); ?>
      <h4>(dispayed using an unordered list with an id of "my_list")</h4>
      <? $map->showValidPoints("list","my_list"); ?>
        </body>

    </html>[/code]
  7. I have a select statement that works but I need to add a default value from a database

    my value is

    [code=php:0]<? echo $row['CategoeyID']; ?>[/code]

    My WORKING Select Statement

    [code=php:0]<?
      echo '<SELECT name="category" >';
      echo "<OPTION>Select a category</OPTION>\n";
      foreach ($category as $c)
      echo "<OPTION value={$c['CategoryID']}>{$c['category_description']} </OPTION>\n";
      echo '</SELECT>';
    ?>[/code]

    My Broken Statement

    [code=php:0]<?
      echo '<SELECT name="category" >';
      echo "<OPTION>Select a category</OPTION>\n";
      foreach ($category as $c)
      echo "<OPTION value={$c['CategoryID']} if($row['CategoeyID'] == $c['CategoryID']){selected='selected'}else{}(>{$c['category_description']} </OPTION>\n";
      echo '</SELECT>';
    ?>[/code]
  8. I have a table that holds the path to a file

    home/myname/public_html/site1/Images/bbd61948840809e5a0d83b3cf21bdd47.png

    What I want to do is cut the
    home/myname/public_html/site1/Images/


    My code that gets the results is

    <td colspan="2" class="Results" ><img src="<? echo $info[0]['ImagePath1'] ?>"></td>

    and this returns
    a broken image and the properties of that image is

    http://mydomain.com/home/myname/public_html/site1/Images/bbd61948840809e5a0d83b3cf21bdd47.png
  9. I have a feild in my table called path this shows the full path of a file like

    /home/jeffnort/public_html/site1/GarageSaleImages/de126f931451872c80680e72ca3ac4df.png

    What I need is just the
    GarageSaleImages/de126f931451872c80680e72ca3ac4df.png

    part

    what can I use to trim

    /home/jeffnort/public_html/site1
  10. I have a table in my db called tbl_category

    THe structure of the table is

    CategoryID
    ParentID
    sort_order
    category_description

    the way the table is structured is that each item has a CategoryID.

    The problem is that say I have a category_description "Animals" with a CategoryID of "1" ParentID of "0"
    Then I have a category_description "Birds" with a CategoryID of "2" ParentID of "1"
    Then I have a category_description "Dogs" with a CategoryID of "3" ParentID of "1"
    Then I have a category_description "Cat" with a CategoryID of "4" ParentID of "1"
    The problem is that say I have a category_description "Furniture" with a CategoryID of "5" ParentID of "0"
    The problem is that say I have a category_description "Toys" with a CategoryID of "6" ParentID of "0"

    I want the menu to lokk like

    Animals
    -Birds
    -Dogs
    -Cat
    Furniture
    Toys

    Now my code

    [code]function getcategorymenu(){
    global $connection;
    $sql=mysql_query("select * from tbl_category ORDER BY sort_order")or die(mysql_error());
    while($row=mysql_fetch_array($sql)) {

    $getcategorymenu .= "<table width='200' border='0'>
        <tr>
          <td>" . stripslashes($row['category_description']) . "</td>
    </tr>
      <tr>
          <td></td>
        </tr>
    </table>";
     
         
      $sqls = mysql_query("select category_description from tbl_category WHERE CategoryID = '$row[ParentID]' ORDER BY sort_order") or die(mysql_error());
      while($rows=mysql_fetch_array($sqls)) {
    $getcategorymenu .="<table width='200' border='0'>
    <tr>
          <td>" . stripslashes($rows['category_description']) . "</td>
    </tr>
      </table>";
    }


    }
    return $getcategorymenu;
    }[/code]

    Currently this code returns

    something like

    Animals

    Dogs

    Animals
    Cats

    Animals
    Birds

    Animals
    Reptiles

    Animals
    Horses

    Animals
    Rabbits

    Animals
    Gerbils

    Animals
    Hamsters

    Animals
    Art

    Books
  11. My Code that displays the image that returns this

    GIF89a÷ÿtÓAaÇ1b·PY¾,X¾+C§"ØëÞæíðÖëܵè°ãíìÙìàãíí°Úµ®ç¦ÌèÔÅéÄÜìãÔëØ»öˆ¶è±{¾räíî×LÜìä]Ã.×ëÝ~¾t¯ç¨}¾t£ën[À,kÀRáìê^¹NhÈ@U¸-”â_¨ãƒbÂ=Ôÿ¤®ð|M²'ƒÂ|jÆ>œçgU»){ÇimÏ:ßZŽàXÛKn¼^ñþáR¸(¾÷‹Æü“¨íuÊêÌ[À.‡ØWH®%­ï{R¸+–àkÚìáÚèé¾ø‹xÅg†ÚWáý¯»òÓÿ¥Äú‘ÀꦩìwnÏnÁOmÅOmÏ9N°*c½JEª$„ÛOÝþ«Ÿåv]Â/R°CãÿÄ}ÖSpÎEÂꩶݺ¼÷‰Þÿ½ÆfÛÿ¶­ï|¨ívuÍHÝìåÉý–ŠßVšåg[·LR·)Ðÿ’͉W¼-†ÙWÓþ©iÍ5¸ô„­ïzZÀ/žçl«íyïÿº¢á|©ç ªç~öÿÂýÿÉèÿÐÂÞÐìÿÖqÒ>àÿª€¾väÿ®]Ä-Óþ wÓMìÿÓÔÿ¡ÖcžèjÇû”g¿Pc¸Se¹Q€×MÎèÖ}ÆbîþÝÛìâ`¾7vÔBÚéç…ÚU]¼4†ÂÞìçåÿ²ÐèÛÔOuÐD‹Ú`ŽÜb±ì‡bÈ2fË3fË4˜ßlÕþ«ÊäÔÍçÖkÁOÇêÈÕëÚ—äblÌ:nÏ;nÑ;»ìšC¨!²ç¬G¬#Ýý»à]¼êžºô†J¯&žát=£ ‹ÞYaºFåýÌæýÏâÿÇñþä~ÓPzÕGqÊCQ¸*ÃꬦìqjÎ7¶Ü½eÂ:[¹GÝý¼Çý‘|ÅgM´'`µPÜÿ´¶ô‚wÅ[®îzÑçÝ©ív~ÍcwÏI^Ã/Èý–Éý—‰ÝW˜åfÔëÙÍèÔ‚ÆiQ¶)Q¶*yÐJÐþžbÆ1W¼,|ÖI¯Ú´W½,Žß[ÖLÓþ¨L±&hÌ5Íý›I¯$¸õ„®ï|¿é½©íuZÁ,žælçíò!ùÿ,ÿÿ (¤X.%ÎÌü’ôi Ç»€´)Y D&JAÜøï@¦JcŒ:†,Ѓ "+[¯4ÔÖ;™ÒáXYPÐ{•‰+š5€Å¥š88ãp¤:‡r£;D^H±FÃI>`&ì™2MÄœ9PÄj:êÛŒ8%Zxà·„>¼=›TK†Ñ r© ‰N,ܬ3…§'ÊÀ1“jK .ÀV€W½f.ôËÐ(Çñl\ ¦kdÉð©»Ó'@+hLpÝÒ¢gU˜?TtùßKéÜ…cÀ² ó.¼ó”È^»?zœö-€Î€v¶Na"×

    Instead of an Image.

    [code]<?
    header("Content-type: image/gif"); 
    include("include/sitefunctions.php");
    include("include/connection.php");

    $itemid = $_POST['ItemId'];
    echo $itemid;

    $info=getpicturecontent($itemid);


    ?>

    <html>
    <head>
    <title>Image Display</title>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    <!--
    .box {
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12px;
        border: 1px solid #000000;
    }
    -->
    </style>
    </head>

    <body>


    <?
    echo $info;
    ?>[/code]

    My Function

    [code]function getpicturecontent($inId){
    global $connection;
    $sql="select * from images where ItemId='$inId'";
    echo $sql;
    $result=mysql_query($sql,$connection) or die(mysql_error());
    while($row=mysql_fetch_array($result)) {
    $getpicturecontent .= "<table width='200' border='0'>
        <tr>
          <td>" . $row['content'] . "</td>
        </tr>
        <tr>
          <td></td>
        </tr>
      </table>";
    }
    return $getpicturecontent;
    }[/code]
  12. I am storing images in mysql (don't ask its a client request) I can see the images in Navicat as images but when I go to get it out with a select statement I get garbage.

    my code

    [code]function getpicturecontent($inId){
    global $connection;
    $sql="select * from images where ItemId='$inId'";
    echo $sql;
    $result=mysql_query($sql,$connection) or die(mysql_error());
    while($row=mysql_fetch_array($result)) {
    $getpicturecontent .= "<table width='200' border='0'>
        <tr>
          <td>" . $row['content'] . "</td>
        </tr>
        <tr>
          <td></td>
        </tr>
      </table>";
    }
    return $getpicturecontent;
    } [/code]


    This returns a bunch of characters. I know there is a header call I have to do but I cant find it.
  13. I have a table with the following item

    tbl_mytable

    ID
    Title
    Description


    I want to write a sql statment that returns the value of the id but randomly

    say if the values for ID are 1,2,3,4.....

    I need the sql to return 2 one time then 4 the next and 1 the next and so on.

  14. I figured it out

    [code]function getmenu(){
    global $connection;

    $sql=mysql_query("SELECT * from menu order by sort_order") or die(mysql_error());


    $getmenu .= "<table width='100%' border='0'><tr><td><span class='copy'>&nbsp;&nbsp;&nbsp;&nbsp;";

    while($row=mysql_fetch_array($sql)) {
    $getmenu .= "<a href=javascript:menulink(" . $row['ID'] . ")>" . stripslashes($row['title']) . "&nbsp;|&nbsp;&nbsp;";
    }

    $getmenu .= "</span></td></table>";


    return $getmenu;
    }[/code]
  15. OK I have my code

    that displays a dynamic menu like

    item1 | item2 | item3 |

    the problem is the last | i need to trim it off

    so i should get

    item1 | item2 | item3

    [code]function getmenu(){
    global $connection;

    $sql=mysql_query("SELECT * from menu order by sort_order") or die(mysql_error());


    $getmenu .= "<table width='100%' border='0'><tr><td><span class='copy'>&nbsp;&nbsp;&nbsp;&nbsp;";

    while($row=mysql_fetch_array($sql)) {
    $getmenu .= "<a href=javascript:menulink(" . $row['ID'] . ")>" . stripslashes($row['title']) . "&nbsp;|&nbsp;&nbsp;";
    }

    $getmenu .= "</span></td></table>";


    return $getmenu;
    }[/code]
  16. I have a table that holds values for a menu I then have a function that I call that build that menu
    I want to add a &nbsp;|&nbsp; between the values so the menu looks like

    item1 | item2 | item3 | item4 ........


    [code]function getmenu(){
    global $connection;

    $sql=mysql_query("SELECT * from menu order by sort_order") or die(mysql_error());

    while($row=mysql_fetch_array($sql)) {
    $getmenu .= stripslashes($row['title']);


    }

    return $getmenu;
    }

    ?>[/code]
  17. I have a function the goes out and gets heading for a news category like

    Todays News

    Yesterdays News

    Once I get those categories I then want to get the news under them

    Like


    Todays News

    News Story 1
    News Story 2
    News Story 3

    Yesterdays News

    News Story 1
    News Story 2
    News Story 3

    ok In my function I want to do all this and then return the value back to my page in one return statement so I can position the values on my page

    My Function


    [code]function getcategorynews($inId){
    global $connection;
    $sql=mysql_query("select * from webcontent_news_category ORDER BY RAND() LIMIT $inId")or die(mysql_error());
    while($row=mysql_fetch_array($sql)) {
    $getcategorynews .= "<table width='200' border='0'>
        <tr>
          <td>" . stripslashes($row['category_description']) . "</td>
    </tr>
      </table>";
      $sqls = mysql_query("SELECT `webcontent_news`.`short_description`
    FROM
    `webcontent_category_x_news`
    Inner Join `webcontent_news` ON `webcontent_news`.`NewsID` = `webcontent_category_x_news`.`NewsID`
    WHERE
    `webcontent_category_x_news`.`CategoryID` =  '$row[CategoryID]'") or die(mysql_error());
    while($rows=mysql_fetch_array($sqls)) {
    "<table width='200' border='0'>
    <tr>
          <td>" . stripslashes($row['short_description']) . "</td>
    </tr>
      </table>";
    }



    }
    return $getcategorynews;
    }[/code]
  18. ok I have three tables the first table holds the category Name
    Somthing like

    tbl_category

    CategoryID
    Category Name

    The second table holds news information Something like

    tbl_news

    NewsID (int)
    News Title (varchar80)
    News Content (blob)

    The third table joins the two tables

    tbl_news_join_category

    ID (INT)
    NewsID (INT)
    CategoryID (INT)

    this way I can have a news article belong to many different Categories ok

    my function


    [code]function news(){

    global $connection;
    $sql="select * from tbl_category";
    $result=mysql_query($sql,$connection) or die(mysql_error());
    while($row=mysql_fetch_array($result)) {
    $news .= "<table width='200' border='0'>
        <tr>
          <td>" . stripslashes($row['category_name']) . "</td>

        </tr>
        <tr>
          <td></td>
        </tr>
      </table>";
    }
    return $news
    }[/code]

    This returns the category name as it should now what I would like to do is do a query after the

    [code]<td>" . stripslashes($row['category_name']) . "</td>[/code]

    and display all the news titles that belong to that category

    then continue on
    with the rest of the code

    [code]</tr>
        <tr>
          <td></td>
        </tr>
      </table>";
    }
    return $news
    }[/code]
×
×
  • 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.