squiblo
Members-
Posts
483 -
Joined
-
Last visited
-
Days Won
2
Everything posted by squiblo
-
I just did a test... i deleted this part #nav_profile td{ padding: 4px; border: 1px solid #999999; } ...but still the border-bottom did not turn white so therefor it is not overriding it
-
In the url, when "mypage=mypage" the td with the class="mypage" is supposed to have have a border-bottom: 1px solid white but it stays 1px solid #999999 what am i doing wrong? <style> #nav_profile td{ padding: 4px; border: 1px solid #999999; } <?php $mypage = $_GET['mypage']; echo " td.$mypage { border-top: 1px solid #999999; border-left: 1px solid #999999; border-right: 1px solid #999999; border-bottom: 1px solid white; } "; ?> </style> <table bgcolor='#EFEFEF' id='nav_profile'> <tr> <td class='mypage' bgcolor='white'>MyPage</td> </tr> </table>
-
i think just giving your div a width should do it
-
or if there is another way to find center page without using css that would be helpfull
-
the code below works in all browers for positioning the div in the middle of the page apart from I.E because they are GAY and think they are special. Any ideas on how to get this to work, thanks. .black_back { width: 510px; height: 510px; position:fixed; top: 0; right: 0; bottom: 0; left: 0; margin: auto; background-color:black; border:1px solid black; /* for IE */ filter:alpha(opacity=30); /* CSS3 standard */ opacity:0.3; z-index: 2; } <div class='black_back'> TEXT </div>
-
Thank you salathe, ill stop trying to use the goto funtion. Any suggestions on how to do this without using "header("location:...")?
-
Hi, I have never used the "goto" function before, and I am having a little trouble understanding it, I have a very simple script to upload profile pictures. When the picture is uploaded I want it to goto another part of the script and echo "upload successfull" but for some reason "upload successfull" is always being echoed even before anything is uploaded. If there is a better way of doing this please help. Thanks. <?php mysql_connect("","","") or die ("Couldn't connect"); mysql_select_db("") or die ("Couldn't find db"); $username = $user->data['username']; if ($_POST['submit']) { //GET FILE ATTRIBUTES $name = $_FILES['myfile']['name']; //append user ID make name unqiue $name = $user->data['user_id'] . $name; $tmp_name = $_FILES['myfile']['tmp_name']; if ($name) { $query_check = mysql_query("SELECT * FROM profile_set_data WHERE username='$username'"); $num_rows = mysql_num_rows($query_check); if ($num_rows != "0") { //start remove OLD from file process while ($row = mysql_fetch_assoc($query_check)) { $file_remove = $row['image_location']; } unlink($file_remove); //start upload NEW process $location = "content/logged_bar/hub/myprofile/profile_pics/$name"; move_uploaded_file($tmp_name,$location); $query_upload = mysql_query("UPDATE profile_set_data SET image_location='$location' WHERE username='$username'"); goto complete; } else { //start upload process $location = "content/logged_bar/hub/myprofile/profile_pics/$name"; move_uploaded_file($tmp_name,$location); $query_upload = mysql_query("INSERT INTO profile_set_data VALUES('','$username','$location')"); goto complete; } } else echo "Please select a file"; } $query_check = mysql_query("SELECT * FROM profile_set_data WHERE username='$username'"); $num_rows = mysql_num_rows($query_check); if ($num_rows != "0") { while ($row = mysql_fetch_assoc($query_check)) { $profile_pic = $row['image_location']; } } else $profile_pic = "bob"; echo " <table width='100%'> <tr> <td> <table width='30%' class='profile_pic' align='left'> <tr> <td><b>Current Picture</b><br><br><img src='$profile_pic' width='100%' height=''></td> </tr> </table> <table width='70%' class='upload_table' align='right'> <tr> <td><br><h3>Upload Picture</h3></td> </tr> <tr> <td>You can upload a JPG, GIF or PNG file.<br><br> <form action='' method='POST' enctype='multipart/form-data'> <input type='file' name='myfile'> <input type='submit' name='submit' value='upload'> </form> </td> </tr> </table> </td> </tr> </table> "; ?> <?php complete: echo "upload successfull"; ?>
-
thanks thorp, i had my logics all messed up
-
Becuase I could end up with 2 notenumber 3's ... for example: notenumber 1, notenumber 2, notenumber 3 if notenumber 2 gets deleted... I will have... notenumber 1 and notenumber 3 and when the user creates a note mysql counts the number of rows and add 1 to create a new notenumber hence notenumber 1 and notenumber 2 = 2 notes so the next note created will be notenumber 3 so i will have 2 note number 3's
-
Display something only if something is in that field in the db
squiblo replied to erme's topic in PHP Coding Help
After connecting to your db you can use "mysql_num_rows" which looks a little something like this: $inter = mysql_query("here you put whatever your query is"); $record_count = mysql_num_rows($inter); if ($record_count >= 1) { while($r = mysql_fetch_array($inter)) { echo "<div class=\"". ($r['Package']) ."\">"; echo "<h2>" . $r['BusinessName'] . "</h2>"; echo "<address>THE ADDRESS IS:" . $r['Address'] . "</address>"; echo "</div> \n"; } } else die("You do not have an address"); -
Firstly, what I am trying to do it delete data from Mysql. To give you a better understanding, this is what happens: Users adds a note, the first note they make is put in the column "notenumber" as 1 The user adds a 2nd note, this is then put under column "notenumber" as 2 and so on, and so on I want the user to be able to delete a note but without messing the notenumbers up, for example if data is deleted it may look like this: notenumber 1, notenumber 2, notenumber 4. How can i delete a notenumber without leaving a gap? Thanks
-
i have also tried using a while loop to change the id's like the following, but this still does not work (both of the texts do not change when either is clicked) please help. <script type="text/javascript"> function toggle_view(id) { var div = document.getElementById(id); var x=0; while (x < 10) { var text = document.getElementById(x); x++; } if(div.style.display == 'block' ) { div.style.display = 'none'; text.innerHTML = "Change"; } else { div.style.display = 'block'; text.innerHTML = "Hide"; } } </script> <a id='0' href='#' onclick="toggle_view('something')">Change</a><br> <div id='something' style="display:none;">Content of div something</div> <a id='1' href='#' onclick="toggle_view('another')">Change</a><br> <div id='another' style="display:none;">Content of div another</div>
-
okay so if i change the id's to "displayText1" and "displayText2" how can i modify the javascript to suite this.
-
if you scroll down you will see one with an id='something' and one with id='another'
-
This is what i have so far and it is nearly perfect. The only problem is that when i click the second link the displayText of the first link changes instead of the second one. <script type="text/javascript"> function toggle_view(id) { var div = document.getElementById(id); var text = document.getElementById("displayText"); if(div.style.display == 'block' ) { div.style.display = 'none'; text.innerHTML = "Change"; } else { div.style.display = 'block'; text.innerHTML = "hide"; } } </script> <a id='displayText' href='#' onclick="toggle_view('something')">Change</a><br> <div id='something' style="display:none;">Content of div something</div> <a id='displayText' href='#' onclick="toggle_view('another')">Change</a><br> <div id='another' style="display:none;">Content of div another</div>
-
there has to be a way to do this :S i cant let this defeat me haha
-
i have added the min-width to the body but that doesnt have seemed to have done anything, the problem is that the content in the div tag is alway 230px from the right no matter how small the browsing window gets
-
#three { right: 230px; position: fixed; width: 248px; padding-bottom: 10px; text-align: left; } when the browser window is made slightly smaller or the screen resolution is low this <div> that is fixed starts to overlap and cover other elements on the page, is there a way around this?
-
i came up with a little something that works well and is very simple, i created a field in my db called "loggedin" when the user logs in the field value for that user changes to 'yes' and when the user logs out the the value is changed to 'no'. and in the login script it checks for the value of the field and if it is 'yes' then "die('this user is already logged in')" but if not then it continues with the rest of the script
-
this is a very general question, how is more than one login by a user on different computers or different web browsers prevented? is it possible if using sessions? what methods and functions are used? etc etc
-
my date is held in the variable "$date" and when echoed it shows 2009-11-16 in the format type of Y-mm-dd how can i change it to "dd-mm-Y"?
-
this part of code... <?php $to = "[email protected]"; $send = $_POST['send']; //line 50 if ($send) { $fullname = $_POST['fullname']; $subject = $_POST['subject']; $message = $_POST['message']; echo "$fullname - $subject - $message"; } ?> gives this error but what is the problem?
-
i have never had this problem before and i am confused to why this is happening...for example this code... <?php if ($_SESSION['myusername']) echo "logout"; ?> will come up with an error message saying... the error message only somes up when the session has been set... if any other information is needed to solve this problem, please tell me.
-
how is mt_rand() different from rand()?