Jump to content

eli312

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

About eli312

  • Birthday 04/09/1992

Profile Information

  • Gender
    Male
  • Location
    England

eli312's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Maybe you should check out cron scripts http://en.wikipedia.org/wiki/Cron
  2. Well i got it working. I shall explain how. I found the fix here: http://bugs.mysql.com/bug.php?id=53232 (in the comments) also here http://bugs.mysql.com/bug.php?id=55530 But it took me a while to understand so i try to explain it easier. Open Terminal and enter the following: sudo nano /usr/local/mysql/support-files/mysql.server This will open up the mysql.server file used to start up MySQL. Then press ctrl + W to search for type in 'basedir=.' (with out the quotes) Once you have found this line change it from: basedir=. To basedir=/usr/local/mysql Next search for 'mysqld_pid_file_path=$datadir/`hostname`.pid' (with out the quotes) Again change it from: mysqld_pid_file_path=$datadir/`hostname`.pid To mysqld_pid_file_path=$datadir/`/bin/hostname`.pid Thats all the changes you need to make press ctrl + X and save the changes. You might want to restart you computer for the effects to take places. I then got a problem with MySQL not wanting to start up automatically but i fixed this here: http://discussions.apple.com/thread.jspa?messageID=12796285 sudo chown -R root:wheel /Library/StartupItems/MySQLCOM (although i cannot now turn it off but thats not such a big problem) Hope this helps anyone out there with this problem. Sorry that it is a little long
  3. Im guessing no one has ever had this problem before? I have uninstalled around 10 times i have installed both - Mac OS X ver. 10.6 (x86, 64-bit), DMG Archive - Mac OS X 10.5 (x86, 64-bit), DMG Archive Both do not start. I have gone though many "fix's" none have done anything, it will still not start. Is there a problem with snow leopard? Is there a fix? Please help sorry if i sounding desperate but i am. Thank you Eli
  4. Hello, I am trying to re-install MySQL after i did a clean upgrade to snow leopard the other day. I downloaded Mac OS X ver. 10.6 (x86, 64-bit), DMG Archive (mysql-5.5.8-osx10.6-x86_64.dmg) from: http://dev.mysql.com/downloads/mysql/ I installed all three of the files inside: - mysql-5.5.8-osx10.6-x86_64.pkg - MySQLStartupItem.pkg - MySQL.prefPane They all installed fine but in the Preference Pane when trying to start MySQL nothing happens (after asking for my password) If i try starting MySQL via termal using - sudo /usr/local/mysql/support-files/mysql.server start I get this error: "/usr/local/mysql/support-files/mysql.server: line 256: my_print_defaults: command not found Starting MySQL ERROR! Couldn't find MySQL server (./bin/mysqld_safe)" I have heard you need xcode but i do not have this installed. Please can someone help me to get MySQL running. Thank you
  5. I have found away around it. NOT A FIX. The problem seems to be caused by the 'about' variable being passed in the xmlhttp.open i do not know if this is as there is a lot of information and there is a 'limit' on the about of text that can be sent though one variable. So the way around it was to remove the about variable... So as i said its NOT a fix as i know can not update the about information but i shall just leave it....
  6. Bump... No ideas anyone?
  7. Hello All, I believe this is ajax (sorry if it is not) I am trying to save without refreshing the page. when you press the save button it runs gets all the values using getElementById and then sends it to another forum - see code below. There is quite a lot to explain please stick with it as you might be able to help me.... var membersave = '../script/member_save.php?id='; function MEMBER_Save() { var id = document.getElementById('mem_id').value; var about = document.getElementById('mem_about').value; var firstname = document.getElementById('mem_firstname').value; var lastname = document.getElementById('mem_lastname').value; var email = document.getElementById('mem_email').value; var username = document.getElementById('mem_username').value; var pass = document.getElementById('mem_password').value; var repass = document.getElementById('mem_repassword').value; var day = document.getElementById('mem_day').value; var month = document.getElementById('mem_month').value; var year = document.getElementById('mem_year').value; var resetpass = "off"; if(document.member_editform.mem_reset_pass.checked == true){ resetpass = "on"; }else{ resetpass = "off"; } var resetimg = "off"; if(document.member_editform.mem_reset_image.checked == true){ resetimg = "on"; }else{ resetimg = "off"; } var admin = "off"; if(document.member_editform.mem_admin.checked == true){ admin = "on"; }else{ admin = "off"; } if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else{// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");} xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState!=4 || xmlhttp.status!=200){ document.getElementById("mem_saving").innerHTML="<img src="+LoadImage+">"; setTimeout('errorloading(\'mem_saving\')',5000); } if (xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById("mem_saving").innerHTML=""; var reply = xmlhttp.responseText; MEMBER_Reload(id,reply); } } xmlhttp.open("GET",membersave+id+"&about="+about+"&firstname="+firstname+"&lastname="+lastname+"&email="+email+"&username="+username+"&pass="+pass+"&repass="+repass+"&resetpass="+resetpass+"&day="+day+"&month="+month+"&year="+year+"&resetimg="+resetimg+"&admin="+admin+"&type=edit",true); xmlhttp.send(); } Now the above seems to work fine on my computer but does not work at all on the online server the loading bar just keeps going around and around. it is also rava strange as i use nearly the same code to save another thing - and this works..... I have worked out that the problem seems to be caused by this line: xmlhttp.open("GET",membersave+id+"&about="+about+"&firstname="+firstname+"&lastname="+lastname+"&email="+email+"&username="+username+"&pass="+pass+"&repass="+repass+"&resetpass="+resetpass+"&day="+day+"&month="+month+"&year="+year+"&resetimg="+resetimg+"&admin="+admin+"&type=edit",true); if i remove all the other variables and text - it works (obviously this is not very useful as now nothing is being passed to the other page to save) xmlhttp.open("GET",membersave+id,true); If you have any ideas please let me know. If there is anymore information you need/want please let me know. Thank you in advance. Eli
  8. Thanks guys for the help. In the end i decided to go a different way (as making a progress bar was complex) I simple used a little javascript/jquery not to do anything more fancy then hide the uploading functions and replace with loading please wait and an animated gif. <form action="upload.php" name="upload_music" enctype="multipart/form-data" method="POST" onsubmit="checkUpload();"> Using the onsubmit to call checkUpload function function checkUpload() { $("#Music").fadeOut(); $("#upload").fadeOut(); $("#upload_box").fadeOut(); $("#upload_boxAlert").fadeIn(); } Which as i said hides the uploading and replaces it with: <div id="upload_boxAlert">File uploading please wait...<br/><br/><img src="<?php echo IMG_LINK; ?>/mucLoader.gif"><br/><h2>(this could take up to 30 minutes)</h2></div> I probably end up making a a real javascript progress bar. But thanks for the ideas and help guys! Eli
  9. I will have to try these out when i get home. But is there not a function to like getbytes sent? so you could compare the file size with how much has been sent to create a simple persentage. Then use AJAX to update it.
  10. Hey all, Not sure if this is in the correct place (sorry if it is not) But i have been looking for hours now for a simple progress bar system when uploading bigger files. Im not even looking for good looking loading bar a simple percent would be good for me. But every site i have looked at to get any help or ideas from the comments are "Does not work", "Error" and that sort of thing. I have even tried many myself and can not get them to work. (at least 5-6) Some even requires the you to install add on programs to your sever - this i can not do as i don't own it. There must be a easy way to solve this problem? Please help Thank you. Eli
  11. Problem has been solved in another topic. The problem was Variable scope and all it need was the function to call global. // Includes the layout pages function site_layout($template="") { global $session; include(SITE_ROOT.DS.'layout'.DS.$template.".php"); }
  12. Thank you very much! problem solved! // Includes the layout pages function site_layout($template="") { global $session; include(SITE_ROOT.DS.'layout'.DS.$template.".php"); }
  13. Thank you for the fast reply. But this is only a small part of a big problem. But i think it is still caused by Variable scope. as i want to get to my session class file and run a function but i am still getting that problem. <?php require_once("includes/session.php"); // Includes the layout pages function site_layout($template="") { include('layout/'.$template.".php"); } ?> Run raw code:<br/> <?php if($session->is_logged_in()) {echo "<a href=\"#\">Logout</a></div>";}else{echo "<a href=\"javascript:showhide('login')\">Login</a> | <a href=\"#\">SignUp</a></div>";} ?> <br/> <br/> Run from function:<br/> <?php site_layout('test')?> Session.php file: <?php class Session { private $logged_in=false; public $user_id; function __construct() { session_start(); $this->check_login(); if($this->logged_in) { } else { } } public function is_logged_in() { return $this->logged_in; } public function login($user) { // database should find user based on username/password if($user){ $this->user_id = $_SESSION['user_id'] = $user->id; $this->logged_in = true; } } public function logout() { unset($_SESSION['user_id']); unset($this->user_id); $this->logged_in = false; } private function check_login() { if(isset($_SESSION['user_id'])) { $this->user_id = $_SESSION['user_id']; $this->logged_in = true; } else { unset($this->user_id); $this->logged_in = false; } } } $session = new Session(); $s =& $session; ?> This gives me this:
  14. Ok so i have been trying so solve this for a few days now. So i am using a function to include my layout files. But if i place a variable outside the file it can't seem to call from it. Example index file: <?php // Includes the layout pages function site_layout($template="") { include('layout/'.$template.".php"); } $hello_world = "helloWorld!"; ?> Call variable from page: <?php echo $hello_world;?> <br/> <br/> Call layout From function: <?php site_layout("test2");?> Test2 file: <?php echo $hello_world; ?> When script is run on website: So what is going wrong?
  15. Take alook at this http://php.net/manual/en/function.shuffle.php. So your code should be something like this: <?php $numbers = range(1, 20); shuffle($numbers); foreach ($numbers as $number) { echo "$number "; } ?>
×
×
  • 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.