Jump to content

Problem with CWP displaying SC images


This topic is 4478 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I'm creating a website thru CWP using the PHP assistant and connecting via filemaker api to a filemaker file hosted via filemaker server.

I've been successful getting everything working except for the link back to the SC files to be able to display images on the website. I've gone thru all the SC tutorials and tried everything. The current iteration of the code below is where I'm at the moment. I've even tried pasting the direct URL to the SC image into the code. There is obviously much more to the php doc, but I'm just copying the html table where the error seems to be occurring. I'm very new to PHP and so any help regarding this would be appreciated. I've attached the full PHP file if that helps.

The 1st line in bold is attempting to display an image from a SC URL

The 2nd line in bold is successfully displaying an image from a standard fm container

<table cellpadding="1" cellspacing="0" class="recwidth">

<tr>

<td valign="top">

<form method="post" action="editrecord.php">

<div>

<?php $dbName = "CKD_Catalog";?>

<?php $layName = "CWP_BrowseRecord";?>

<input type="hidden" name="-db" value= "<?php echo htmlentities($dbName,ENT_NOQUOTES,'UTF-8',false);?>">

<input type="hidden" name="-lay" value="<?php echo htmlentities($layName,ENT_NOQUOTES,'UTF-8',false);?>">

<input type="hidden" name="-recid" value="<?php echo $recid ?>">

</div>

<table cellpadding="1" cellspacing="6" class="record">

<!-- Display record field values -->

<tr class="field">

<td class="field_name">

<?php echo str_replace(' ', '&nbsp; ',htmlentities('Style #:',ENT_NOQUOTES,'UTF-8',false));?>

</td>

<td class="field_data">

<?php echo nl2br(str_replace(' ', '&nbsp; ', storeFieldNames('StyleNo', 0, $record, true, 'EDITTEXT', 'text')))?>

</td>

<td rowspan="8" class="field_data">

<?php echo "<img src='php_pdt_FIL__pvt_id::SCFullLink' title='Error' alt='Error' />";?>

</td>

</tr>

<tr class="field">

<td class="field_name">

<?php echo str_replace(' ', '&nbsp; ',htmlentities('Code:',ENT_NOQUOTES,'UTF-8',false));?>

</td>

<td class="field_data">

<?php echo nl2br(str_replace(' ', '&nbsp; ', storeFieldNames('Code', 0, $record, true, 'POPUPLIST', 'text')))?>

</td>

</tr>

<tr class="field">

<td class="field_name">

<?php echo str_replace(' ', '&nbsp; ',htmlentities('Product:',ENT_NOQUOTES,'UTF-8',false));?>

</td>

<td class="field_data">

<?php echo nl2br(str_replace(' ', '&nbsp; ', storeFieldNames('ProductTitle', 0, $record, true, 'EDITTEXT', 'text')))?>

</td>

</tr>

<tr class="field">

<td class="field_name">

<?php echo str_replace(' ', '&nbsp; ',htmlentities('Dimensions:',ENT_NOQUOTES,'UTF-8',false));?>

</td>

<td class="field_data">

<?php echo nl2br(str_replace(' ', '&nbsp; ', storeFieldNames('Dimensions', 0, $record, true, 'EDITTEXT', 'text')))?>

</td>

</tr>

<tr class="field">

<td class="field_name">

<?php echo str_replace(' ', '&nbsp; ',htmlentities('Category:',ENT_NOQUOTES,'UTF-8',false));?>

</td>

<td class="field_data">

<?php echo nl2br(str_replace(' ', '&nbsp; ', storeFieldNames('Category', 0, $record, true, 'POPUPLIST', 'text')))?>

</td>

</tr><tr class="field">

<td class="field_name">

<?php echo str_replace(' ', '&nbsp; ',htmlentities('Product Category:',ENT_NOQUOTES,'UTF-8',false));?>

</td>

<td class="field_data">

<?php echo nl2br(str_replace(' ', '&nbsp; ', storeFieldNames('ProductCategory', 0, $record, true, 'POPUPLIST', 'text')))?>

</td>

</tr>

<tr class="field">

<td class="field_name">

<?php echo str_replace(' ', '&nbsp; ',htmlentities('Brand:',ENT_NOQUOTES,'UTF-8',false));?>

</td>

<td class="field_data">

<?php echo nl2br(str_replace(' ', '&nbsp; ', storeFieldNames('Brand', 0, $record, true, 'POPUPLIST', 'text')))?>

</td>

</tr>

<tr class="field">

<td>

</td>

<td class="field_data">

<img src=

"<?php echo getImageURL(storeFieldNames('php_pdt_LOG::LogoContainer', 0, $record, true, 'EDITTEXT', 'container'))?>">

</td>

</tr>

<!--Display record form controls-->

<tr class="submit_btn">

<td width="100">

</td>

</tr>

</table>

</form>

</td>

</tr>

</table>

browserecord.php

Link to comment
Share on other sites

Hey Sander,

What does the field: "php_pdt_FIL__pvt_id::SCFullLink" return? If it returns the "Files/" protocol in the URL, this is NOT what you want. You will want to return a URL containing the "RawData/" protocol. So, something like this would work:

<img src="http://ipaddress.com/SuperContainer/RawData/path/to/my/image" />

I hope this helps.

Regards,

Link to comment
Share on other sites

This topic is 4478 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.