SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Hybrid View

  1. #1
    SitePoint Addict joyce's Avatar
    Join Date
    Aug 2001
    Posts
    295
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    passing value from ssi to php

    i want to pass a value to my disimage.php from shtml. is the code correct? it does not pass any value to that php page. what is wrong with it? please help!


    the code:
    <!--#include virtual="/review/admin/disimage.php?subcat=Net"-->

  2. #2
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what's the filetype of the file that has that ssi?
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  3. #3
    SitePoint Addict joyce's Avatar
    Join Date
    Aug 2001
    Posts
    295
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i'm using
    include virtual in ssi. is this the filetype u are asking?
    as for file extension is .shtml

  4. #4
    SitePoint Enthusiast
    Join Date
    Aug 2001
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Inside of your include file, have you declared all variables as global? example: global $x;

    Declaring all of the variables as global may set their scope to page level not your included page level. So declare all of your varibles as global in the include file.
    SiteTell.com: Get the best viral marketing tool on the planet and watch as the number of unique visitors to your site soars!

  5. #5
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    not 100% sure, but i don't think you can pass stuff from a php script in a .sthml file.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  6. #6
    SitePoint Addict joyce's Avatar
    Join Date
    Aug 2001
    Posts
    295
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've declared all the variables as global.

  7. #7
    SitePoint Addict certify's Avatar
    Join Date
    May 2001
    Location
    Malaysia
    Posts
    216
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    joyce why not attach the code for them to view? That way they will know what is wrong with it.
    Your WebHosting Partner - RouterWebHost.com
    eXam SIMulation Software - ExamSim.net
    geeks forums -ProgrammingTutor.com
    BMWClub of Malaysia - BMWClub.com.my
    unofficial MU Fan Club coming soon - ManchesterUnited.com.my


  8. #8
    SitePoint Addict joyce's Avatar
    Join Date
    Aug 2001
    Posts
    295
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    below is the code that from disimage.php. i want to pass the value of subcat,

    <!--#include virtual="/review/admin/disimage.php?subcat=Net"-->
    to the php file as below.


    echo "<table width='100%' border='0' cellspacing='1' cellpadding='0' align='center'><tr bgcolor=#000000><td>";
    echo "<font face='verdana' color=#FFFFFF size='2'><b>&nbsp;Categories</b></font></td></tr>";
    echo "<tr height=10></tr></table>";

    global $subcat;
    $table = "cat_review";
    $field = "*";
    $criteria = "order by cat_cat asc";
    $review_obj=new review_DB($dbhost,$dbusername,$dbpasswd,$db);
    $getdata=$review_obj->get_data($table, $field, $criteria);
    $data=$getdata[0];
    $numrows=$getdata[1];

    if ($numrows > 0)
    {
    for ($i=0; $i < $numrows; $i++)
    {
    $id = $data[$i][0];
    $cat = $data[$i][1];
    $subcat = $data[$i][2];
    $title = $data[$i][3];
    $desc = $data[$i][4];
    $image = $data[$i][5];

    echo"<table width=100% border=0 cellpadding=1 cellspacing=1>";
    echo "<tr><td width=20%>";
    echo"<table width=100% border=0 cellpadding=1 cellspacing=1>";
    echo "<tr><td width=80%><a href=\"../admin/display.php?gid=$id&cat=$cat&subcat=$subcat&title=$title&desc=$desc&image=$image&flag=$flag\"><img src=\"".$data[$i][5]."\" width=80 height=120 border=0></a>\n</td></tr>";
    echo "</table>";
    echo "<td width=80%>";
    echo "<table width=100% border=0>";
    echo "<tr><td width=100%><font face=arial size=3><b><u>$subcat</u></b></font>&nbsp;<font face=arial size=1>($cat)</font></td></tr>";
    echo "<tr><td width=100%><font face=arial size=2><b><i>$title</i></b></font></td></tr>";
    echo "<tr><td width=100%><font face=arial size=2>$desc</font></td></tr>";
    echo "</table>";
    echo "</table>";
    echo "<hr>";
    }

    }

  9. #9
    Victory shall be mine tubedogg's Avatar
    Join Date
    Mar 2001
    Location
    Medina, OH
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't do what you're asking. Which is weird cause I thought it would work but after some testing it apprently doesn't.

    Just for general reference, variables do not need to be set as global in PHP unless inside a function or class.
    Kevin


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
  •