henrikb Posted September 2, 2007 Share Posted September 2, 2007 Hi, I like to my members to be able to include audio and video on their profile page. The EDIT PROFILE page has the following code where the member can enter the audio/video info: $audio = "<textarea name='audio' class='text' cols='45' rows='3'>".stripslashes($row["cAudio"])."</textarea>"; $video = "<textarea name='video' class='text' cols='45' rows='3'>".stripslashes($row["cVideo"])."</textarea>"; My question is, I like to have a default audio and video file which are used if the member do not change the default values above, how to I do that? Appreciate your help! Henrik Quote Link to comment https://forums.phpfreaks.com/topic/67641-solved-newbie-using-a-default-value-in-php-script/ Share on other sites More sharing options...
hostfreak Posted September 2, 2007 Share Posted September 2, 2007 You could create a field in the database, something like: video_selected. If they change the video put a 1 as the value, if not, leave it as 0. Then base the code off the value from the field in the database. Edit: if your storing the source of the video in the database, just check to see if it's not the default value with an if/else statment: if (stripslashes($row["cAudio"]) == "default value) { //default code } else { //other code } Quote Link to comment https://forums.phpfreaks.com/topic/67641-solved-newbie-using-a-default-value-in-php-script/#findComment-339792 Share on other sites More sharing options...
henrikb Posted September 2, 2007 Author Share Posted September 2, 2007 Hi, Thanks very much for your help! Henrik Quote Link to comment https://forums.phpfreaks.com/topic/67641-solved-newbie-using-a-default-value-in-php-script/#findComment-339795 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.