Jump to content

eli312

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Everything posted by eli312

  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 "; } ?>
  16. First I'm just going to say if you don't know how to do this with out asking i guess your going to have a few problems. Secondly answering your question. What i would do is make a table (call it whatever you want) and then link the members id to freinds id. But that depends on how big your site going to get.
  17. define("priority_3","<span class=\"priority_3\">Normal</span>", ture); should be: define("Priority_3","<span class=\"priority_3\">Normal</span>", true); then: define("Priority_3","<span class=\"priority_3\">Normal</span>", true); echo Priority_3;
  18. not 100% sure what you mean but. So you only want to pull from the DB the rows were col_a and col_b do not match?
  19. That's the thing it is. if i post the raw code: <?php require_once("includes/initalize.php"); ?> <?php if($session->is_logged_in()) {echo "You are logged in<br/>";}else{echo "You are not logged in<br/>";}?> <?php include("layout/test.php");?> <?php site_layout("test");?> Into index it works fine and i now get: Meaning to me it seems to be an error with the function but the function it self works as in if i put. echo "hello world"; inside test.php and use the function site_layout("test"); to call it. It will echo hello world. So the problem is that is loses the variable and i dont understand why
  20. Hi, So your trying to get more results per page on facebook? and you dont know any php, yes? Well i shall start off saying that php can not be read by looking at the source code. Nothing in what you have pasted is php. Secondly the way the results per page found is probably using some sort of function in whats called a class. Or it could be anywhere else. So unless you find something in the URL bar that indicates how maybe per page (which is unlikely) Then what you are trying to do is imposable. Your best chance is to contact facebook some how as i have always found this very hard, and maybe they will change it.
  21. :BUMP Ok, So i thought i would make it easier to understand. I have 5 files: -initalize.php -functions.php -test.php -session.php -index.php So this is my errors when i go on to index.php So what is the problem? Sorry for long message have a lot to say Thanks to anyone that can help. Eli
  22. Thank you for your reply but the session_start(); is in the class and it all works fine if as long as i put the code all in index. but if i include that code from another file into the index it seems to forget where the session class is...
  23. Hi, i am getting an error that seems to be happening when i use the include function. so my index file at the top includes a file that links to all the classes. require_once("includes/start.php"); now the rest of the page is mainly html/css and it all works fine. if i then put in the code for the login system which calls upon the session to check if logged in. (at the top just bellow the require_once start.php) if(!$session->is_logged_in()) { /* do somthing */ ;} else { /* do somthing */ } if (isset($_POST['login'])) { // Form has been submitted. $email = trim($_POST['email']); $password = trim($_POST['password']); // Check database to see if username/password exist. $found_user = Member::authenticate($email, $password); if ($found_user) { $session->login($found_user); $_SESSION['message'] = "<div class=\"GreenMessage\"> You are now Logged in. </div>"; } else { // username/password combo was not found in the database $_SESSION['message'] = "<div class=\"RedMessage\"> Error. Email/password could not be found. </div>"; } } else { // Form has not been submitted. $username = ""; $password = ""; } then the next line of code is my big problem. <?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>"; }?> So basically if logged in it changes to log out. And again this all works fine until i put this code about into a file and include it onto the index. When i then get this error: And that is my problem once in the include it can not find the variable. 1. i have tried putting the require_once("includes/start.php"); at the top but that does not do anything. 2. i am thinking it might be an ordering problem as in the order all the code is run but i can seem to work out how it done. Also just for your information inside the start.php is this: defined('DS') ? null : define('DS', DIRECTORY_SEPARATOR); defined('SITE_ROOT') ? null : define('SITE_ROOT', DS. 'Users' .DS. 'Eli' .DS. 'Sites' .DS. 'MusicSite'); defined('SITE') ? null : define('SITE', DS. '~eli' .DS. 'MusicSite'); defined('LIB_PATH') ? null : define('LIB_PATH', SITE_ROOT.DS.'includes'); defined('SITE_TITLE') ? null : define('SITE_TITLE', 'MusicSite.com'); require_once(LIB_PATH.DS."config.php"); require_once(LIB_PATH.DS."functions.php"); require_once(LIB_PATH.DS."database.php"); require_once(LIB_PATH.DS."member.php"); require_once(LIB_PATH.DS."session.php"); Thank you for your time and help. Eli
  24. ok, so i removed the http:// bit and just left it as checkthisot.hotoi.com now this solved one problem but i still have Fatal error: require_once() [function.require]: Failed opening required 'checkthisot.hotoi.com/includes/config.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/a29896/public_html/includes/initalize.php on line 8 Warning: require_once(checkthisot.hotoi.com/includes/config.php) [function.require-once]: failed to open stream: No such file or directory in /home/a29896/public_html/includes/initalize.php on line 8 So now is the problem it can not find the files? and the code in initalize.php: <?php defined('DS') ? null : define('DS', DIRECTORY_SEPARATOR); defined('SITE_ROOT') ? null : define('SITE_ROOT', 'checkthisot.hotoi.com'); defined('LIB_PATH') ? null : define('LIB_PATH', SITE_ROOT.DS.'includes'); require_once(LIB_PATH.DS."config.php"); require_once(LIB_PATH.DS."functions.php"); require_once(LIB_PATH.DS."session.php"); require_once(LIB_PATH.DS."database.php"); require_once(LIB_PATH.DS."member.php"); ?> Sorry if im being very noobiesh.
  25. Hi, So i am making a website using PHP and such. Now i am using a mac running Apache with PHP and MySql installed. When running it on my mac everything, i have set up a login system and that all works fine reads from the database and everything running off my mac. So i thought i was ready to upload to the web so i changed all the database things and sorted everything out. But i keep getting this error: Warning: require_once() [function.require-once]: URL file-access is disabled in the server configuration in XXXXXXXXXXXXXXXXXXXXXX on line 8 Warning: require_once(http://XXXXXXXXXXXXXXXXXXXXXX) [function.require-once]: failed to open stream: no suitable wrapper could be found in XXXXXXXXXXXXXXXXXXXXXX on line 8 Fatal error: require_once() [function.require]: Failed opening required 'http://XXXXXXXXXXXXXXXXXXXXXX' (include_path='.:/usr/lib/php:/usr/local/lib/php') in XXXXXXXXXXXXXXXXXXXXXX on line 8 So i read in to this and people are saying that you need to have "allow_url_fopen = ON" and "allow_url_include = On" So i checked what was running on my side and i had allow_url_fopen = ON and allow_url_include = OFF then check the website side. and it was the same.. so im quite confused as to what is really going wrong with my site... if anyone can help please do. thanks. :confused:
×
×
  • 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.