LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-06-2004, 06:28 PM   #1
DropHit
Member
 
Registered: Oct 2003
Posts: 95

Rep: Reputation: 15
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;

	}
 
Old 07-06-2004, 11:27 PM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
syntax highlighting for php in emacs bm1 Linux - Software 2 04-15-2017 04:29 AM
Please, helpme on Mandrake 10.1 !!!! gustavomds Mandriva 2 03-23-2005 11:36 PM
Helpme! smita Linux - General 2 06-09-2004 12:48 PM
PHP Trouble Syntax Gerardoj Programming 2 03-30-2004 09:10 PM
helpme xtreme3232 Linux - General 3 12-21-2002 12:24 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration