PDA

View Full Version : php help


akstudio348653
06-03-2010, 10:10 AM
I hope someone can help.

I have this piece of code:

$sbm = new SimpleBM($_SESSION['UserID'],1);


My question is.... how would I "echo" the $_SESSION['UserID'] part in the above?

Thanks.

Jimmy Wu
06-03-2010, 10:15 AM
This should echo that part out:

echo($_SESSION['UserID']?$_SESSION['UserID']:"Not set");

You would just put it above or below the other call and it should display the UserID if it is set and Not set if it isn't.

akstudio348653
06-03-2010, 01:39 PM
Thanks, that seems to have gotten me a few steps forward. However, I had to set this project aside as Ive run into too many issues.

I guess I'll ask, since I am here... hope it doesn't get too hidden... I'm looking to create a bookmark system. It works like this:

1. User logs in
2. browses through a ton of videos...
3. while browsing, they can "bookmark" the video for later viewing.
4. when the user returns at a later date, they can visit their profile page to view all of their bookmarks.

Bookmarks need to be stored as:

page title
time of bookmark
link to the page with the video

I found this: http://codecanyon.net/item/simple-bookmark/79865

However, I just cannot get it to work with WebAssist tools, with all the authentication and such.

Do you think it is possible to build such a system with the webassist tools only? Ive tried, and have run into a few snags... seems like it would require a bit more scripting than the tools offer, as I need to grab the URL, allow for removal of bookmarks, etc.

Thanks for any advice.

Jimmy Wu
06-03-2010, 02:55 PM
well, if the videos each have a specific id or identifier, you could link to the videos using that identifier. The add bookmark would add an entry to the database with the userID and the videoID and when the user logs in you would have a repeat region that loops on the results returned from the search. If the videos are stored in the same location, the links to the videos shouldn't be hard to be created from the videoID.

akstudio348653
06-09-2010, 08:15 AM
Thanks, I now have this working

Jimmy Wu
06-09-2010, 11:55 AM
Great to hear it. If you run into any additional issues, feel free to open a new thread.