LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   If Then PHP syntax helpme (https://www.linuxquestions.org/questions/programming-9/if-then-php-syntax-helpme-201932/)

DropHit 07-06-2004 06:28 PM

If Then PHP syntax helpme
 
This is easy but I CAN NOT get it to work basically i have to formats fo data going into the smae field of my dbase, one has the url attached for people who are hosting thier own pics and one is simply the name of the pic on my server i need to figure out how to determine what kind of data is being pulled hten adjust the path accordingly. I have this so far




Code:

$title = mysql_result($result,$i,"title");

                                $id = mysql_result($result,$i,"id");

                                $date = mysql_result($result,$i,"ends");
                               
                                $pic = mysql_result($result,$i,"pict_url");
                               
                                $buy = mysql_result ($result,$i,"buy_now" );
                               
                                $bid = mysql_result ($result,$i,"minimum_bid" );
                               
                                $bid = print_money($bid);

                                $exclude = "http";
                               
                                if (!$pic)

        {

                $pic = "nopic.jpg";

                }

        else

        {

                $pic = $pic;

        }

if ($pic == $exclude)



        {

                $pic = "uploaded/$pic";

                }

        else

        {

                $pic = $pic;

        }


crabboy 07-06-2004 11:27 PM

I think what you are trying to do here is find a line that begins with http?
Code:

if ($pic == $exclude)

What you need is something like substr-compare.

http://www.zend.com/manual/function.substr-compare.php


All times are GMT -5. The time now is 02:26 AM.