-
Posts
88 -
Joined
-
Last visited
Never
Everything posted by sean04
-
Is there a shorter version of this. I made it so it toggles between "Edit Profile" and "Cancel" <div id="showEditLink" style="block"> <a href="#" onclick="document.getElementById('edit').style.display='block';document.getElementById('profile').style.display='none';document.getElementById('showProfileLink').style.display='block';document.getElementById('showEditLink').style.display='none';">Edit Profile</a> </div> <div id="showProfileLink" style="display:none"> <a href="#" onclick="document.getElementById('edit').style.display='none';document.getElementById('showEditLink').style.display='block';document.getElementById('showProfileLink').style.display='none';document.getElementById('profile').style.display='block';">Cancel</a> </div> <div id="edit" style="display:none;"> Name: <input value="Sean"/> </div> <div id="profile" style="display:block;"> Name: Sean </div>
-
Like a stylesheet class? or like <div class = "edit"><a href = "...">EDIT</a></div> Sorry, I'm not to familiar with it.
-
Thanks! and what exactly would .edit_link be?
-
How would you make it so one <div> disappears as another one appears. Kind of toggle divs.
-
How would I go about writing a script where once you hover over an entire fieldset, I little icon appears and says "edit".
-
I know this can be more secure but I'm not sure how. Any suggestions? <?php if($logged[user_ID]) { if(isset($_GET['upload'])) { $filename = $_FILES["avatar"]["name"]; $tmp_name = $_FILES["avatar"]["tmp_name"]; $useridnum = $loggedinuser[user_ID]; $avatar = "testupload/$filename"; $username = $logged[username]; if (move_uploaded_file($tmp_name, "testupload/".$useridnum.$filename)) { $query = mysql_query("UPDATE `members` SET `avatar` = '$avatar' WHERE `username` = '$login[username]'"); echo ("File uploaded $avatar, $username"); } else { echo "Uploading file Failed"; } } } ?> Also, I added useridnum because I want filename to never repeat. I realize I need more then just the user id. Anyone have any other ideas for that to? I guess maybe a random number string possibly? Thanks for any help, Sean
-
Thank you both for your comments! And litebearer, I was aware it was Psuedo code and i figured your 1's were suppose to be i's. Thanks!
-
OK and what is the purpose of the 'i' if its not being used?
-
So something like this? I haven't tried it yet <?PHP $InterestsList = $_POST[interests]; $Interests= explode(",", $InterestsList); $InterestsCount = count($Interests); connect to database $l=0; while ($1 < InterestsCount) $variable = array value[$l] $result = mysql_query(insert into interests (User_ID,Interests) values($loggedin[user_ID],$variable)); } ?>
-
Yes I see what your doing. I will have to give that a try and see how it works out. Thanks for the reply, Sean
-
Thank you Pikachu2000. That sounds like a reasonable way to do it. I will take a look into that. That being said, I'm still interested on how I would come about completing this in a way that my first post stated. If I have something like this: <?PHP $InterestsList = $_POST[interests]; $Interests= explode(",", $InterestsList); ?> After something like that, how would I loop all the values into a table that looks like the one in my first post? Thanks for the help!
-
Thanks for the reply. I haven't written anything just yet. I'm looking at a few things right now. I am looking into what you suggested. I was just looking for some options
-
As of now I have a textbox that I will tell users to place a comma in between each word they write. I would like all of these words to be broken up by the commas and inserted into a database. The database is something like this and the text field like this User 1 Enter Activities: Hockey,Soccer,Running User 2 Enter Activities: Baseball Activities Database: User_ID Activity 1 Hockey 1 Soccer 1 Running 2 Baseball Any code samples or links will be great! Thanks!
-
Could someone please give me a hand. $logged[user_ID]; is the user id of the current logged in user. How would I go about writing this query and get the country for a specific user?
-
Thanks! How would I go about putting in $logged[user_ID] which is the User_ID of the current logged in individual so I can get there country?
-
Thanks for the reply! I get this error: Resource id #10 I want to call the results from another page... Like a profile page of that user. $loggedUserCountry = mysql_query("SELECT u.User_ID, c.Country_Description FROM user_detail u JOIN country c ON u.Country = c.ID WHERE User_ID = 'logged[user_ID]'"); Then on the profile page I do this Country: $loggedUserCountry
-
Hey guys, so I have 2 tables... user_detail ID Email Country 1 [email protected] 1 country ID Country 1 Canada 2 States How can I write a query so when I call a variable to get my country it gets "Canada" instead of "1" Thanks!
-
That still doesn't seem to work... I'm not sure why I can't retain values after submitting a form. Here I will post what I have again. $months = array (1 => 'January', 'February', 'March', 'April', 'May', 'June','July', 'August', 'September', 'October', 'November', 'December'); <p <?php if(in_array("Month", $errors)){echo 'class="error"';} ?>> <label for="Month">Birthday:</label> <select name="Month" value="<?php echo $Month ?>"> <option value="">Choose...</option> <?PHP foreach ($months as $value) { echo '<option value="'.$value.'">'.$value.'</option>'; } ?> </select> </p> After submit as of now, the default drop down values will just appear.. not what the user previously chose.
-
I know its not the greatest... Another thing, $months is an array of all the months so I don't think replacing it with $value is an option. Thanks! Sean
-
Hmm... that doesn't seem to work. It still goes to its original value. Any other ideas? Thanks! Sean.
-
Ah ok I see what you did I'll try it later on! Thanks for the help!
-
Thanks! I'll give this a try when I get home. A question though... Where would I put "Choose"? I want the application to error when the selection is "Choose" but anything else (like Jan to Dec) is valid.
-
Sorry I meant submit This is what I have now. <p <?php if(in_array("Month", $errors)){echo 'class="error"';} ?>> <label for="Month">Birthday:</label> <select name="Month" value="<?php echo $Month ?>"> <option value="">Choose...</option> <?PHP foreach ($months as $value) { echo '<option value="'.$value.'">'.$value.'</option>'; } ?> </select> </p> As of now, if choose is selected when the user hits submit, there will be an error telling the user to choose a month. If the user chooses a month and hits submit but there is another error, the value choose will automatically be the selected value in the drop down list once again. I have done something like this but it doesn't seem to work right. <p <?php if(in_array("Month", $errors)){echo 'class="error"';} ?>> <label for="Month">Birthday:</label> <select name="Month" value="<?php echo $Month ?>"> <option value="<?php $_POST['Month']; ?>">Choose...</option> <?PHP foreach ($months as $value) { echo '<option value="'.$value.'">'.$value.'</option>'; } ?> </select> </p>
-
Hey! So I have a register form and there are a few drop down lists on it. If a user selects a month for example (say June) and hits the register button, if there are any errors on the page when the page validates the drop down lists will go back to its original selection value (January). What is the easiest way to keep a users selection even if the page is submitted or refreshed? Hope thats clear Thanks, Sean
-
Thanks! Could you explain the difference? Thanks for the help!