close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Path to session variable

Thread began 11/02/2011 4:10 am by msbannister373603 | Last modified 11/03/2011 2:43 pm by msbannister373603 | 2982 views | 10 replies |

msbannister373603

Path to session variable

I'm having a problem getting a picture show up on the member home page. I've created a session variable that has the name of the picture file that is uploaded to the server and the database. I'm having trouble getting the picture to display on the page. When each page loads the correct filename is displayed. For instance, when the page loads for member1, the correct jpg. files shows in the display site (jpg1). When the page loads for member 2 the correct jpg2 loads. I need to know how to link the path from the file location on my server to the picture files stored in the session variable. I'm sure I'm making a mistake in the path somewhere but can't figure it out.

Sign in to reply to this post

Jason ByrnesWebAssist

the path to the image is a relative path based on the location of the file calling the image.

lets say the page calling the image is at:
page.php

and the image is at:
image1.jpg

the userPages/page.php page needs to move down one directory (../) then look for the images folder to find the image1.jpg file

the image tag for this would look like:

php:
<img  src="../images/"<?php echo(isset($_SESSION['imgName'])?$_SESSION['imgName']:""); ?>" />
Sign in to reply to this post

msbannister373603

Path to Variable

OK This did work but now I have a problem with my session variable. If I plug the picture filename into the path like this: <img src="http://localhost/members/pictures/043.jpg/>, the picture does show up. However, when I replace the code with the variable that I made no pictures shows up. <img src="http://localhost/members/pictures/".<?php echo(isset($_SESSION['member_profilePic'])?$_SESSION['member_profilePic']:""); ?>" />

Does the extension automatically make a variable to hold the pictures that are uploaded. If so, can you tell me which variable it is. I used the Security Assist authenticate user behavior to make the variable member_profilePic. Obviously this isn't working.

Sign in to reply to this post

Jason ByrnesWebAssist

On the page that has the upload behavior, look in the bindings panel, expand the WA Uploaded files (Fiel Field Name) group, there is a binding called Server File Name that will be populated with the name of the uplaoded file.


I assume this is a registrastion form? in the insert record behavior, bind the image column ot the server file name variable to store the image in the database, now the authenticate user behavior should be able to pick it up when the user registers.

Sign in to reply to this post

msbannister373603

Path to Variable

Yes, I've done that and I still can't get the picture to display. On the page where I'm trying to display the picture I have several files in the server variable dropdown list, however none are server file name. The security assist authenticate behavior will not let me create this variable. I'm about out of options and can't figure this out.

Sign in to reply to this post

Jason ByrnesWebAssist

the server file name variable will not show on the profile page, it will be available on the page that you added the upload behavior.


can you send me a copy of the page you added the upload behavior, a copy of the login page and a copy of the page where you are trying to show the picture.

are you sure the file is uploading correctly?

Are you sure the file name is being stored in the database?

All of these ducks need to be lined up before you can display the picture on another page.

Sign in to reply to this post

msbannister373603

Yes the file is uploading correctly and the name is in the database. If I don't apply the image source to the file, the correct filename does display on the page. How do you want me to send you the pages?

Sign in to reply to this post

Jason ByrnesWebAssist

i think i may see the probelm, i had an extra period in my initial example for this

change the img sorce code:
<img src="http://localhost/members/pictures/".<?php echo(isset($_SESSION['member_profilePic'])?$_SESSION['member_profilePic']:""); ?>" />


to:
<img src="http://localhost/members/pictures/<?php echo(isset($_SESSION['member_profilePic'])?$_SESSION['member_profilePic']:""); ?>" />

Sign in to reply to this post

msbannister373603

I had already tried without the period. Just tried again still now showing the picture. Should I send the code or email you the pages

Sign in to reply to this post

Jason ByrnesWebAssist

compress the files into a zip archive and attach the zip archive to your response.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...