Jump to content

squiblo

Members
  • Posts

    483
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by squiblo

  1. If i have this... echo "<span id='$id' onclick='Test()'> blah blah</span>"; How can i get the span id and put it into a JavaScript var?
  2. My query searches for people in the database. If the user searches "bob" it with output "bob marley". If the user searches "marley" it will output "bob marley" also. If the user searches "bob marley" nothing will be outputted how can i explode this... $search = $_POST['search_friend']; to make this query work properly... $search_name_check = mysql_query("SELECT * FROM page_set_data WHERE forname='$search' OR surname='$search'"); Thanks
  3. yes, that is what i meant if i set the hash to something like... #?hash=1234 could i do this... $hash = $_GET['hash']; if that is not possible, how can a javascript variable be placed in a php variable
  4. How can I get the hash stored in a variable? www.domain.com/#1234 Thanks.
  5. When i try to connect to my FTP, I am getting no where and it will not connect. This is my log and errors (that i dont understand). Any ideas? Thanks
  6. i am getting a never ending table with 1 row and never ending columns $get_friend_id = mysql_query("SELECT * FROM page_zebra WHERE user_id='$user_id' AND friend=1 LIMIT 0,9"); $count=0; $num_cols = 3; echo "<table border='1'>"; while($row = mysql_fetch_array($get_friend_id)){ if($count == 0 && $count % $num_cols == 0) echo "<tr>"; if($count != 0 && $count % $num_cols == 0) echo "</tr><tr>"; //echo row data in <td><td> $count++; } //finish table. fill in blank cells. while($count % $num_cols != 0){ echo "<td> </td>"; } echo "</tr></table>";
  7. another idea, how could i put the 9 pieces of data into 9 different variables or an array like $friend_id[0] = ???; $friend_id[1] = ???; $friend_id[2] = ???; $friend_id[3] = ???; $friend_id[4] = ???; $friend_id[5] = ???; $friend_id[6] = ???; $friend_id[7] = ???; $friend_id[8] = ???;
  8. sorry im finding it hard to understand that
  9. I want the data from this query... $get_friend_id = mysql_query("SELECT * FROM page_zebra WHERE user_id='$user_id' AND friend=1 LIMIT 0,9"); while($row = mysql_fetch_assoc($get_friend_id)){ $friend_id = $row['page_zebra_id']; to be displayed in a 3x3 table there will not always be exactly 9 pieces of data sometimes less, sometimes more. How is this possible?
  10. $totalfriends = intval($totalfriends);
  11. that query is working fine but is displaying like 1.0000 how can i display the value as an integer?
  12. i have put $friend_check = mysql_query("SELECT (COUNT(*) / 2) AS totalFriends FROM page_zebra WHERE (page_zebra_id='$user_id' OR user_id='$user_id') AND friend=1"); $total_friends = mysql_numrows($friend_check); but get this error
  13. How can I make the following two queries into just 1 query so I dont have to divide by 2 at the end. this is what the db table looks like.... || user_id || page_zebra_id || friend || foe || 2 53 1 0 53 2 1 0 $friend_check = mysql_query("SELECT * FROM page_zebra WHERE user_id='$user_id' AND friend=1"); $first_friends = mysql_numrows($friend_check); $friend_check = mysql_query("SELECT * FROM page_zebra WHERE page_zebra_id='$user_id' AND friend=1"); $second_friends = mysql_numrows($friend_check); $total_friends = ($first_friends + $second_friends) / 2;
  14. I have just been reading a few things about the new HTML5 that is slowing being introduced. And HTML5 has a lot of big expectations to take over a lot of other languages. What have you heard about this language? What rumors have you heard? What have you read about HTML5? ETC.... Thanks.
  15. Thanks to all those who have give me guidance, I will continue college and graduate and then decide where I want to go from there, but I know for sure that I want to go into web development. Please could you say how you got to where you are today and if there is anything you would change if you had the chance to go back in time. Thanks again!
  16. Also what qualifications are employers looking for...all I can find is: CIW (Certified Internet Webmaster)
  17. Thank you for your input jamkelvl, please keep them coming, they will be very useful for me.
  18. What are your opinions on the following website... http://www.computeach.co.uk/web-design-courses
  19. Hi all, I am currently at college doing courses that I really don't like, (Maths, Physics, P.E) but I LOVE computing, and web design/programming is what I want to do in the future and pursue it as a career in the future. Note - Sorry if I have posted in the wrong section of the forum. I am looking to drop out of college and pay for web design/programming courses, and I thought would be a great place to ask for advise. Where can I find a good course? Will the course be worth it? What can the course lead me onto in the future? Any other advise will be much appreciated. Thank you.
  20. greatstar00 i changed the quotes to double quotes but then they both didnt work. What do you mean about the css and uploading raw textarea because i dont quite understand? could anyone try and describe it differently please? if this is needed, this is how i uploaded the data to the db... if (isset($_POST['submit_about'])) { if (isset($_POST['textarea_about'])) { $textarea_about = nl2br(strip_tags($_POST['textarea_about'])); if (strlen($textarea_about) < 301) { mysql_query("UPDATE page_set_data SET about_me='$textarea_about' WHERE username='$username'"); header("location:http://www.squiblo.com/content.php?content=myhub&myhub=mypage&mypage=mypage&cont=$cont"); } else $about_error = "<ul><li>Maximum of 300 characters.</li></ul>"; } }
  21. so basically, this script does not work when $about_me is data from mysql!! WHYY??? ive never seen anything like this before
  22. ok this is the strangest thing ive ever seen.... this following code works.... <?php $about me = "text<br />text"; ?> <?php $about_me = str_replace('<br />', '<br>', $about_me); ?> <script type="text/javascript"> function toggle_visibility(id) { var div = document.getElementById(id); var text = document.getElementById("about_me_text"); if(div.style.display == 'none' ) { div.style.display = 'block'; text.innerHTML = "<?php $about_me = str_replace('<br>', '\n', $about_me); ?><?php echo $about_error; ?><form action='' method='POST'><textarea cols='23' rows='6' name='textarea_about' id='textarea_about' style='font-family:arial;font-size:13px;overflow:hidden'><?php echo "$about_me";?></textarea><br><input type='submit' name='submit_about' value='Save'> <input type='button' name='cancel_about' value='Cancel' onClick=\"window.location.href='content.php?content=myhub&myhub=mypage&mypage=mypage&cont=<?php echo $cont;?>'\"></form>"; } else { div.style.display = 'none'; text.innerHTML = "<?php $about_me = str_replace('\n', '<br />', $about_me); ?><?php echo $nothing.$about_me; ?>"; } } </script> but this does not work.... <?php $about_me_query = mysql_query("SELECT * FROM page_set_data WHERE username='$username'"); while ($row = mysql_fetch_assoc($about_me_query)) { $about_me = $row['about_me']; } if (!$about_me) { $about_me = ""; $nothing = "Write about yourself"; } ?> <?php $about_me = str_replace('<br />', '<br>', $about_me); ?> <script type="text/javascript"> function toggle_visibility(id) { var div = document.getElementById(id); var text = document.getElementById("about_me_text"); if(div.style.display == 'none' ) { div.style.display = 'block'; text.innerHTML = "<?php $about_me = str_replace('<br>', '\n', $about_me); ?><?php echo $about_error; ?><form action='' method='POST'><textarea cols='23' rows='6' name='textarea_about' id='textarea_about' style='font-family:arial;font-size:13px;overflow:hidden'><?php echo "$about_me";?></textarea><br><input type='submit' name='submit_about' value='Save'> <input type='button' name='cancel_about' value='Cancel' onClick=\"window.location.href='content.php?content=myhub&myhub=mypage&mypage=mypage&cont=<?php echo $cont;?>'\"></form>"; } else { div.style.display = 'none'; text.innerHTML = "<?php $about_me = str_replace('\n', '<br />', $about_me); ?><?php echo $nothing.$about_me; ?>"; } } </script> and the data in the database is exactly the same, i have also connected to the db further up in the page..
  23. The code below is supposed to put the variable $about_me in a textarea by using javascript but i have to change "<br />" to "\n" when it goes into the textarea tags i am getting my logic all wrong trying to do this, and i think i have things in the wrong places. www.squiblo.com/test.php <html> <body> <?php $about_me = "liam<br /><br />!!!!<br />woooo"; ?> <?php $about_me = str_replace('<br />', '\n', $about_me); ?> <script type="text/javascript"> function toggle_visibility(id) { var div = document.getElementById(id); var text = document.getElementById("about_me_text"); if(div.style.display == 'block' ) { div.style.display = 'none'; text.innerHTML = "<?php $about_me = str_replace('\n', '<br />', $about_me); ?><?php $about_me = str_replace('<br>', '<br />', $about_me); ?><?php echo $about_me; ?>"; } else { div.style.display = 'block'; text.innerHTML = "<?php $about_me = str_replace('<br />', '\n', $about_me); ?><?php $about_me = str_replace('<br />', '\n', $about_me); ?><form action='' method='POST'><textarea cols='23' rows='6' name='textarea_about' id='textarea_about' style='font-family:arial;font-size:13px;overflow:hidden'><?php echo $about_me;?></textarea><br><input type='submit' name='submit_about' value='Save'> <input type='button' name='cancel_about' value='Cancel' onClick=\"window.location.href='#'\"></form>"; } } </script> <a href='#' onclick="toggle_visibility('bob');"><font color='CornflowerBlue'>Edit</font></a> <div id='about_me_test'> <?php echo $about_me; ?> </div> </body> </html>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.