basic if/then with PHP
<p>Okay so i set up this thing so that I can print out page that people came from, and then put dummy tags on certain pages.  Some pages have commented out "linkto" tags with text in between them.  </p>

<p>My problem is that some of my pages don't have "linkto" text.  When I link to this page from there I want it to grab everything between "title" and "/title".  How can I change the eregi so that if it turns up empty, it should then grab the title?</p>

<p>Here is what I have so far, I know I just need some kind of if/then but I'm a rank beginner.  Thank you in advance for any help:</p>

<pre><code> &lt;?php

 $filesource = $_SERVER['HTTP_REFERER'];
 $a = fopen($filesource,"r"); //fopen("html_file.html","r");
 $string = fread($a,1024);
 ?&gt;
 &lt;?php
 if (eregi("&lt;linkto&gt;(.*)&lt;/linkto&gt;",
 $string, $out)) {
 $outdata = $out[1];
 }
 //echo $outdata;
 $outdatapart = explode( " " , $outdata);

 echo $part[0];
</code></pre>

<p>?> </p>
