close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

If Then Echo Session

Thread began 10/08/2009 2:27 pm by Cologne | Last modified 10/08/2009 6:14 pm by Cologne | 2912 views | 6 replies |

Cologne

If Then Echo Session

Hi,

I need help :-)

If there is no Validate entry show the session.


If
<?php echo(ValidatedField("bilderHinzufuegen","imageInfo")) ?>

is empty

show
<?php echo $_SESSION['name']; ?>

How do I write that in php, the shortest way?

Denis

Sign in to reply to this post

Dave BuchholzBeta Tester

This will do it for you:

<?php echo(ValidatedField("bilderHinzufuegen","imageInfo ")?ValidatedField("bilderHinzufuegen","imageInfo "):$_SESSION['name']) ?>



basically what this ternary operator is doing is printing the validated entry if it exists and if it doesn't it will print the session value

Sign in to reply to this post

Cologne

Hi dave,

this does not work, it stays the session variable, even if I change the entry.



by the way I tried to answer your question with that DFP upload size.

Denis

Sign in to reply to this post

Dave BuchholzBeta Tester

Denis,

I use this format all the time with VTK, especially with update forms where I need to show either the original value or the updated value if validation catches an error.

How are you using the code and for what purpose ?

Your answer worked for DFP upload size thanks.

Sign in to reply to this post

Cologne

Dave,

i am sorry, I didnt cahnge the name of the validate entrie variable :-(

I changed it and now its:

(ValidatedField("bilderHinzufuegen","photograher") not (ValidatedField("bilderHinzufuegen","imageInfo")?

It works great, THANKS

Denis

Sign in to reply to this post

Dave BuchholzBeta Tester

no worries glad you got it working and thanks again for your help

Sign in to reply to this post

Cologne

I put it on the wishlist, to have that thing back in DFP3.

Good night,
Denis

Sign in to reply to this post

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...