Jump to content

Alex-Grim

Members
  • Posts

    58
  • Joined

  • Last visited

    Never

Everything posted by Alex-Grim

  1. I never knew this site did reviews; i've been releasing websites like normal people change underwear, and only getting feedback from design forums, which doesn't say anything for the developer side. I only came here when i got stuck on something in PHP (which doesn't happen very often), so in the meantime i've created a LOT of websites. I'm just going to post of few of them here all at once, and if it is a problem, then just let me know and i will make a separate thread for each website. For the record, i (my company) OWN these websites, except for 1 of them, where i am (my company is) the developer, designer, SEO company, administrator, and webmaster (everything but the owner ): All of these websites use my company's information management systems. I have SEVERAL in development, and a few of them are about to be ready for business (customers to lease). I wrote EVERY single line of code, and EVERY single SQL statement, EVERY single line of xhtml and css, all by hand, with Gedit. None of the systems that my websites use are anything that you can get from the internet (not even after i release them). WCMS is the acronym for my Website Content Management System. UFMS is the acronym for my User Forum Management System. BIMS is the acronym for my Business Information Management System. UAMS is the acronym for the central User Account Management System. There are more, but i'm not mentioning them right now, because they're not far enough along to be used on any of my websites: Ionisis: web design company, seo company, information management systems is my company's website and it uses the WCMS and UAMS and a couple other smaller systems. Linux Intro: Linux Lessons, Videos, Forums, and Tutorials is where i (or anyone who is interested) can publish articles about Linux, using the WCMS, UFMS, UAMS, and a couple other systems. The Online Personal Organizer and Free Personal Information Organizer is an online organizer that is also mobile accessible. Lol, i always forget to update the mobile version when i change the backend, so half the time the mobile version doesn't work. It also has a firefox plugin. Violent Work of Art: Industrial Metal is a band from sweeden who i developed a website for which runs off many of my beta systems, and i am also the webmaster. Ok, i've got like 6 more websites that i did recently (i work 16 hours a day, 7 days a week, so no, i'm not exaggerating), but i think that this is enough for one post. Let me know what you guys think. Oh, and they all run off Fedora/PHP/MySQL/Apache .
  2. Wow, you really did it much good; it looks way better than the old one. The only suggestion that i might make (just my opinion), is that you might make the banner image join the content area, and use a very subtle background image to distinguish the content are more from the background.
  3. HA, that's great! My members at eInformationOrganizer.com have been bugging the crap out of me to get around to making a visual calendar like that, but i just don't have the time (so they get to use date strings intead ). I'm glad to see that someone did this. It looks good and functions properly, and seems lightweight. Well done .
  4. You might want to add 1 more rule: Must reply to at least 2 other requests for review. This will help to eliminate spam, etc. Also it would be best to require they start with the topics that are OLDER and have the least amount of replies, to help ensure that each user gets a fair turn, and lazy people don't just pick from the top so they can hurry up and post their own. For example, in order of priority: Threads with 0 replies, oldest first, not to exceed second page; Has priority over all else; Threads with 1 replies, oldest first, not to exceed front page; Has priority over all following; Threads with 2 replies, oldest first, not to exceed front page; Has priority over all following; Threads with more than 2 replies, who cares. as code, if might look like this: if (Threads with 0 replies, oldest first, not to exceed second page){ reply to it; }else{ if (Threads with 1 replies, oldest first, not to exceed front page){ reply to it; }else{ if (Threads with 2 replies, oldest first, not to exceed front page){ reply to it; }else{ reply to front page threads with least replies; } } } Eh, just a thought.
  5. Ok, this is driving me insane. I have no problem on the server level, but when trying to set cache control with PHP it simply will not work for me. I WANT cache, and LOTS of it! $expires = 60*60*24*365; $size = filesize("{$client_directory}/{$_GET['did']}"); header("Content-Length: ".$size,true); header("Cache-Control: max-age={$expires}, public, no-transform",true); header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT',true); header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()-$expires) . ' GMT',true); header("Content-type: audio/example"); header("Content-Disposition: attachment; filename=\"{$_GET['did']}\""); readfile("{$client_directory}/{$_GET['did']}"); ALL of the other headers are fine, but the cache control will NOT set??? I've tried so many different ways, and none of them are working. Here are the output headers: Status=OK - 200 Date=Mon, 23 Nov 2009 08:15:19 GMT Server=Apache/2.2.8 (Fedora) Content-Length=4400274 Content-Disposition=attachment; filename="Coma.mp3" Content-Encoding=gzip Vary=Accept-Encoding Keep-Alive=timeout=15, max=100 Connection=Keep-Alive Content-Type=audio/example Thanx
  6. Problem solved! I had to rename the php.ini file in my webroot to php5.ini
  7. UPDATE, i have not been uploading a 9MB file, i have been only able to upload an 8MB file. I just now tried to upload a 9MB file, and i'm getting the same error, but only after 3 minutes now. When i try to upload a 15MB file, it errors after 4 minutes...
  8. Also, this script runs for 4-5 minutes before throwing an error, if that helps at all... Thanx again
  9. I should also add that i have error_reporting set to E_ALL while i'm debugging. So the only error that i get with the large files is: Notice: Undefined index: pwd in /home/content/a/l/e/alexandergrim/html/tmp/Upload2.php on line 73 It is claiming that the password name/value pair/parameter was never sent over, but yet it does not do this if the file is less than 9M, because it IS an input field in the form, and works properly! This has me stumped. Here is the form: <form method="post" enctype="multipart/form-data" action="Upload2.php"> <label for="pwd">Enter your password that i gave you:</label> <br/> <input type="password" name="pwd" id="pwd"/> <br/><br/><br/> <label for="pwd">Now, choose a file to upload:</label> <br/> <input type="file" name="file" id="file"/> <br/><br/> <input type="submit" value="Upload"/> </form> and here is the script that parses it: <?php error_reporting(E_ALL); if ($_POST['pwd'] == "123") { if (move_uploaded_file($_FILES['file']['tmp_name'], $_FILES['file']['name'])){?> <h2 class="heading">Your file was uploaded successfully; <br/><br/> <a href="http://alexgrim.com/tmp/Upload.php">Do you want to upload another file?</a> </h2> <?} else {?> <h2 class="heading">Your file was NOT uploaded successfully!</h2> <br/> The file may have been too large. If so, you may have to find another way to get it to me. <br/><br/> <h2><a href="http://alexgrim.com/tmp/Upload.php">Do you want to try to upload again?</a></h2> <?} } else {?> <h2 class="heading">Your PASSWORD was NOT correct!</h2> <br/> Make sure that your are using the correct UPPERCASE or lowercase letters. For example, if the password is "Banannas" then "banannas" and "BANANNAS" are NOT correct, because it must be spelled EXACLTY like "Banannas". So go back and try to enter your password again. <br/><br/> <h2><a href="http://alexgrim.com/tmp/Upload.php">Do you want to try to upload again?</a></h2> <?} ?>
  10. I am hosting with GoDaddy and i had to throw a page together real quick so that a friend can upload videos to my server with a web interface because they are too large to send via email. The problem is that the page works fine for images and SMALL video files, but after 9MB it will not work any more? I called go daddy and they told me that there are default configuration limits, but that i am allowed to change them as i see fit, because they do not limit the size of the file that we can upload to our account, nor the execution time. They also provided me with this link: http://help.godaddy.com/article/1475? So i changed my config settings in the php.ini file that is in my webroot, and waited for about 20 minutes, and i still cannot upload anything larger than 9MB! Here are my settings with regards to file uploads: max_input_time = 900 max_execution_time = 900 memory_limit = 100M post_max_size = 90M upload_max_filesize = 80M I even confirmed this with this page here: http://us2.php.net/ini.core If you scroll down the page, you will come to this: post_max_size integer Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. If memory limit is enabled by your configure script, memory_limit also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size . When an integer is used, the value is measured in bytes. Shorthand notation, as described in this FAQ, may also be used. If the size of post data is greater than post_max_size, the $_POST and $_FILES superglobals are empty. This can be tracked in various ways, e.g. by passing the $_GET variable to the script processing the data, i.e. <form action="edit.php?processed=1">, and then checking if $_GET['processed'] is set. So it appears that i have my settings correct, but still, no luck. Any ideas? Thanx Also, there is NO input field for upload limit in the upload form, so i know that is not the problem.
  11. Well, if the DB Goes awry, that's GoDaddy''s problem, as i pay for hosting now. But thenx for the help. Oh, and i kow that mysql isn't needed to be extended, but it's already included in a parent script, so i use it like that for simplicity Thanx again, this one had me FUMING!
  12. 4 hours wasted on a stupid mistake that i have never made before: forgetting to ESCAPE the single quotes! Here's the finished product, which works exactly as it should've to begin with: class Bug extends MySql{ function __construct($description){ $h = $_SERVER['HTTP_HOST']; $q = $_SERVER['REQUEST_URI']; if (isset($_COOKIE['uid'])){ $u = stripslashes(str_replace("'","''",$_COOKIE['uid'])); }else{ $u = "Guest, or Not Logged In"; } $d = str_replace("'","''",$description); $t = date("Y-m-d H:i:s"); parent::Q("insert into BugReports (host,uri,uid,ctime,description)values('{$h}','{$q}','{$u}','{$t}','{$d}')"); echo "<h1>There was a bug, but it was caught and reported. You may be contacted with more questions about this bug at a later time.</h1>"; } }
  13. It doesn't matter anymore, i've gotten past that part, to the part that allows me to echo the error from the bug script, so i can access it now, but when i try to insert it into the db, it acts as if it were an object instead of a string. I fkn quit. I'm just going to have to use a seperate page, and pass the mysql error as a query, and then catch it. Till then, it's not being treated as a string.
  14. I tried to use mysql_free_result(); but it's not working either. With the following code, i get the following error: $r2 = $db->Q("insert into WretchedComments (uid,fromid,ctime,message,subject,label,mode)values('".$f->DbSafe($_POST['name'])."','{$_COOKIE['uid']}','".date("Y-m-d H:i:s")."','".$f->DbSafe($_POST['comment'])."','".$f->DbSafe($_POST['subject'])."','unread','$t1')"); if ($r2 != true){ mysql_free_result($r2); Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource
  15. if i add this to the end of my bug report's insert statement, like so: $con->Q("insert into BugReports (host,uri,uid,ctime,description)values('{$this->host}','{$this->uri}','{$this->uid}','{$this->ctime}','{$this->desc}')") [color="red"]or die (mysql_error())[/color]; It gives me the OTHER INSERT STATEMENT'S error Message!?!? Why would it do this? This must be why it's not getting entered into the DataBase.
  16. if i add this to the end of my bug report's insert statement, like so: $con->Q("insert into BugReports (host,uri,uid,ctime,description)values('{$this->host}','{$this->uri}','{$this->uid}','{$this->ctime}','{$this->desc}')") [color="Red"]or die (mysql_error())[/color]; It gives my the OTHER INSERT STATEMENT'S error Message!?!? Why would it do this? This must be why it's not getting entered into the DataBase.
  17. Here, i'm just going to post the whole freakin thing: I've got an index page. EVERYTHING in the WHOLE site come through the index page. The index page includes the MySql class, so, it's already available for any other scripts included in the page later. I have a script that is supposed to insert a record into the database, but i purposely name one of the fields wrong, so that i can test my Bug Class. I will include all the code in a second. If the query returns FALSE then the Bug Class is called. The Bug class's constructor accepts one argument -- the error details. It has NO OTHER methods. It takes the details, along with some server variables, and inserts them into my Bugs table. The Bugs class Extends MySql -- which is already included via the index page. The problem is, i am NOT able to catch the mysql_error and pass it along to the Bug class. BUT, it the MySql class, when calling a query, i can say "or die(mysql_error)", and it will give me the error just fine. This is crap... Here's the codes: Insert statement: $r = $db->Q("insert into WretchedComments (uid,fromid,ctime,message,subject,label,mode)values('".$f->DbSafe($_POST['name'])."','{$_COOKIE['uid']}','".date("Y-m-d H:i:s")."','".$f->DbSafe($_POST['comment'])."','".$f->DbSafe($_POST['subject'])."','unread','$t1')"); if ($r != true){ $b = new Bug("Could not insert new comment: ". mysql_error()); } And here's the mysql function for queries: function Q($sql){ $query = mysql_query($sql);// or die(mysql_error()); return $query; } and here's the bug class: <?php class Bug extends MySql{ private $host; private $uri; private $uid; private $desc; private $ctime; function __construct($description){ $this->host= $_SERVER['HTTP_HOST']; $this->uri = $_SERVER['REQUEST_URI']; if (isset($_COOKIE['uid'])){ $this->uid = stripslashes(str_replace("'","''",$_COOKIE['uid'])); }else{ $this->uid = "Guest, or Not Logged In"; } $this->desc= $description; $this->ctime=date("Y-m-d H:i:s"); parent::__construct(); parent:(); parent::Q("insert into BugReports (host,uri,uid,ctime,description)values('{$this->host}','{$this->uri}','{$this->uid}','{$this->ctime}','{$this->desc}')"); parent::C(); echo "<h1>There was a bug, but it was caught and reported. You may be contacted with more questions about this bug at a later time.</h1>"; } function R(){ } } ?> Now, when there IS an ERROR, the bug class will output it's error message, but it won't catch the error from the previous mysql statement, and insert it into the db. One of the ways i was tryig this, it would insert the bug report, but without the mysql_error. Now, i've messed with it so much, it's not even doing that.
  18. That's fkn stupid that i can't edit my post. IGNORE THAT LAST POST. i found that error, but that's still not the one that's not catching the mysql errors. I still have the same problem
  19. I've narrowed it down to the Bug Class. I'm having a problem on autoloading AND extending the Mysql class. How the hell am i to call the parent constructor when extending and autoloading, if the Bug class is being called from a page that has also already included the Mysql class via autoload? <?php class Bug extends MySql{ private $host; private $uri; private $uid; private $desc; private $ctime; function __construct($description){ $this->host= $_SERVER['HTTP_HOST']; $this->uri = $_SERVER['REQUEST_URI']; if (isset($_COOKIE['uid'])){ $this->uid = stripslashes(str_replace("'","''",$_COOKIE['uid'])); }else{ $this->uid = "Guest, or Not Logged In"; } $this->desc= $description; $this->ctime=date("Y-m-d H:i:s"); parent::__construct; parent:(); parent::Q("insert into BugReports (host,uri,uid,ctime,description)values('{$this->host}','{$this->uri}','{$this->uid}','{$this->ctime}','{$this->desc}')"); echo "<h1>There was a bug, but it was caught and reported. You may be contacted with more questions about this bug at a later time.</h1>"; parent::C(); } function R(){ } } ?> Fatal error: Undefined class constant '__construct' in This is due to auto loading it...
  20. I even tried this just now (completely different approach) to no avail function BugOut($args){ $this->O(); $this->Q("insert into BugReports (host,uri,uid,ctime,description)values('{$_SERVER['HTTP_HOST']}','{$_SERVER['REQUEST_URI']}','{$_COOKIE['uid']}','".date("Y-m-d H:i:s")."','$args')"); $this->C(); return true; } function Q($sql){ $query = mysql_query($sql); if ($query == false){ $this->BugOut(mysql_error()); return false; }else{ return $query; } }
  21. Ok, i have a mysql class, and it's worked fine for months now, it's not the problem. I just created a Bug Reporting class, and it works... when implemented correctly. When something doesn't go as planned, i call the bug class. Well, i was trying to include the Mysql Errors in the bug reports, but i'm not able to freakin catch them! If i say mysql_query($blah) or die (mysql_error()); It's fine, it KILLS the script, and give the error. BUT, if i do this: function Q($sql){ $query = mysql_query($sql) or $this->bugout($sql); return $query; } I get NOTHING; I've also tried this: function Q($sql){ $query = mysql_query($sql); if ($query == false){ $B = new Bug("There was an error in a query. Details: " . mysql_error()); }else{ return $query; } } and this (con being the connection object.) function Q($sql){ $query = mysql_query($sql); if ($query == false){ $B = new Bug("There was an error in a query. Details: " . mysql_error($this->con)); }else{ return $query; } } and this function Q($sql){ $query = mysql_query($sql); if ($query == false){ $B = new Bug("There was an error in a query. Details: " . $sql); }else{ return $query; } } And i'm getting NOTHING in return. I get the plain text section of the error, but not the variables or the mysql_error. I could eat glass right now! Thanx
  22. Hey guys, i've got a question about the imagecreate function. It seems that if i use this in a function, that i cannot directly output the image to the browser, as i get the following error: The image “http://alexgrim.test/includes/classes/tmp.php” cannot be displayed, because it contains errors. So far, this wasn't an issue, because i'm writing them to disk when uploaded. But now, the problem is that i'm generating random number images to verify that you are human. Well, i can't output the dynamically created image to the browser if i use it in a class method, yet, if i include it directly into the page it's being used from, it's just fine? Here is my code, but keep in mind that i have also tried using output buffering to see if that matters, but it made no difference. This is the page that calls the class method: <?php include_once("Image.php"); $i = new Image(null); $rslt=$i->RandomImg('667'); ?> And here's the method: function RandomImg($str){ header ("Content-type: image/jpg"); $im = @imagecreatetruecolor(120, 60); $text_color = imagecolorallocate($im, 233, 14, 91); imagestring($im, 1, 5, 5, $str, $text_color); imagejpeg($im); imagedestroy($im); } I have tried directly copying the code from php.net for this, and, as i have already said, it didn't work unless i run it on the page i'm using it on, directly. I can't call it as a method. Thanx
  23. After trying this pice of code, i get mixed results. I get the string correct, but the IF statement fails for some reason? Here's the code, then the output: $xml2 = new SimpleXMLElement("../sitemap.xml",null,true); foreach ($xml2->url as $loc){ if ($loc->loc == "http://LinuxIntro.com?action=".$qx1[0]."&name=".$_GET['name']){ echo "I found IT!<br/>"; }else{ echo "Not it!<br/>"; echo "http://LinuxIntro.com?action=".$qx1[0]."&name=".$_GET['name']."<br/>"; echo $loc->loc . "<br/>"; } } Which returns: Not it! http://LinuxIntro.com?action=ShowContent&name=aaaaaaaaaaaaaa http://LinuxIntro.com/ Not it! http://LinuxIntro.com?action=ShowContent&name=aaaaaaaaaaaaaa http://LinuxIntro.com?action=ShowContent&name=aaaaaaaaaaaaaa What i am attempting to accomplish, is to remove a page from my sitemap, when i delete it from the database. I have the opposite effect in place already; when i create a new page via my admin console i wrote, it adds that page to my sitemap. Now i need the reverse done: when i delete a page from the DB, it is also removed from the sitemap. ===EDIT=== Also, i guess, just for clarity, i should add the contents of my xml file: <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.google.com/schemas/sitemap/0.84" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd"> <url> <loc>http://LinuxIntro.com/</loc> <changefreq>daily</changefreq> <priority>0.3</priority> </url> <url> <loc>http://LinuxIntro.com?action=ShowContent&name=aaaaaaaaaaaaaa</loc> <changefreq>daily</changefreq> <priority>0.3</priority> </url> </urlset> Thanx
  24. Hey guys, is there a way to remove an element with simplexml? I don't see it in their documentation. If so, how would i go about doing it? Or you could just point me towards documentation. Thanx
×
×
  • 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.