Jump to content

The Little Guy

Members
  • Posts

    6,675
  • Joined

  • Last visited

Everything posted by The Little Guy

  1. Really... I can read it really clearly. The pdf is now gone.
  2. I would like to convert the menu to HTML, I have found many of sites, but none that allow me to make it a particular width. do you know of any site/program to do so? Other than that I have filled most of the pages with content, and changed some of the styles slightly. What do you think of the new changes/additions?
  3. I was able to come up with something like this (untested): create temporary table myFriends select friend_id from partners where user_id = 123; -- List of your friends create temporary table myFriendsFriends select friend_id from myFriends left join partners on (myFriends.friend_id = partners.friend_id); -- List of your friends friends select mff.friend_id mff_id, partners.friend_id from myFriendsFriends mff left join partners on(mff.friend_id = partners.friend_id) having friend_id null; -- List of your friends friends who are not your friends
  4. like this: mysql -u root --password=mypassword --max_allowed_packet=32M
  5. you should add a limit to your sub-query, it should only return one result. I assume your warnings will be telling you that.
  6. in your table, I assume you have a column that tells which product the image belongs to; if not, add one. $product_id = (int)$_GET['id']; $sql = mysql_query("select * total from images where product_id = $product_id"); while($row = mysql_fetch_assoc($sql)){ echo <<<OPT <a href="/images/{$row["pics"]}"><img src="/images/{$row["pics"]}" /></a> OPT; }
  7. Some new Changes: - The image file size is smaller - The main image is now a slideshow - The header has a new background texture
  8. Apache is on server A, and MySQL is on server B, they now have the ability to take a higher load. if MySQL is bogging down server B, it won't affect Apache on server A, unless you have a script trying to talk to MySQL on server B. Lets say you are running a intensive script that is using 90+% CPU server B will/may become very slow and almost unresponsive. If this happens and Apache is on the same server, it will have a harder time trying to answer incoming requests. By splitting the two up, Apache can respond almost instantly in the same situation. But if your web script that is running from Apache (server A) needs to talk to MySQL (server B) it will slow down.
  9. New addition, links like this now work: http://suzie.weblyize.com/#page=restaurant http://suzie.weblyize.com/#page=specials
  10. Thanks guys! I fixed almost everything you guys suggested: - I made it so the nav doesn't ever move, or hide - The "About Suzies" link, works for me in IE/Chrome/Firefox, so I can't really fix it because I can't duplicate the problem. - The menu, I can't figure out how to make fit to the screen, I read I needed to do this: <object data="/media/pdf/menu.pdf#view=FitV" ... - But that solution didn't work at all, so if anyone konws any solution to fix that, that would be great. - In the places that don't have any content, I added some basic text to it. - The logo is now clickable Todo: - Resize the file size of the club sandwich - Fix the texture (I would like to make it look like a weave if anyone has a Photoshop tutorial let me know) Thanks again!
  11. I spent all day yesterday making this layout, I would like it if you could give me some feedback on what you think. Right now there isn't much content, but that isn't what I am currently after. I designed it with Chrome 16, I am still working on getting it to look like chome in IE, and there is a small almost unnoticeable bug in Firefox. Another thing I need to do is make the main image on the home page smaller (500k is too large). Other than all that, what do you think? http://suzie.weblyize.com/
  12. I have the following custom font: @font-face { font-family: ws; font-style: normal; src: url(/media/fonts/ws.eot); src: local("WebServeroff"), url(/media/fonts/ws.otf) format("opentype"); font-weight: normal; font-style: normal; } But it doesn't work in IE any reason why?
  13. you can use ftp to bypass php max file upload limit I believe (Not the only use though). You don't need to use it for download though. php.net file upload: <?php $file = 'somefile.txt'; $remote_file = 'readme.txt'; // set up basic connection $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // upload a file if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) { echo "successfully uploaded $file\n"; } else { echo "There was a problem while uploading $file\n"; } // close the connection ftp_close($conn_id); ?> php.net file download: <?php // define some variables $local_file = 'local.zip'; $server_file = 'server.zip'; // set up basic connection $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // try to download $server_file and save to $local_file if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) { echo "Successfully written to $local_file\n"; } else { echo "There was a problem\n"; } // close the connection ftp_close($conn_id); ?>
  14. preg_replace("/\<(script).*\>.*\<\/(script)\>/isU", " ", $data);
  15. I need a query that gets a list of member id who purchased products 1 and 87. I can not figure out the best way to do this. How can I do this? Here is my table structure: +----------------+------------------+------+-----+-------------------+-----------------------------+ | Field | Type | Null | Key | Default | Extra | +----------------+------------------+------+-----+-------------------+-----------------------------+ | recurring_id | int(11) | NO | PRI | NULL | auto_increment | | member_id | int(11) | NO | MUL | 0 | | | product_id | int(10) unsigned | YES | MUL | NULL | | | special | enum('ap') | YES | | NULL | | | is_enabled | tinyint(1) | NO | MUL | 0 | | | processor_id | int(11) | NO | MUL | 0 | | | member_card_id | int(11) | NO | | 0 | | | date_updated | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP | +----------------+------------------+------+-----+-------------------+-----------------------------+ I thought that this query would work, but it doesn't: select * from recurring where product_id in (87,1) group by member_id order by member_id limit 10; Thanks for any help!
  16. I am using php's zip class, and I am able to zip files up individually, but can I zip an entire directory with its file and sub-folders?
  17. PHP is like life: <?php $is_alive = true; $hunger_level = 100; function beat_heart(){ return "Heart: Thump Thump<br>"; } while($is_alive){ echo beat_heart(); $hunger_level--; if($hunger_level == 0){ echo "Eat: Eating food<br>"; } $revolver_shot = round(rand(0, 6)); if($revolver_shot == 2 || $revolver_shot == 6){ echo "BANG! You just got shot!<br>"; $is_alive = false; } sleep(1); } echo "You are now at your funeral "; ?>
  18. Mysql has a built in increment value, that for every insert will create an auto incremented unique id. I assume you are using PHPMyAdmin, and to add a field like that, you simply set your "Type" to "INT" and use a "Primary" key, next you Need to set that field to auto increment. There are two different versions of PHPMyAdmin, the newer version uses a checkbox called "AUTO_INCREMENT" or "A_I", the older version uses a drop down box called "Extra". After you create that column, you can insert stuff, which would be like a normal insert query, the only difference is you don't have to use the field you just created in that query, because mysql will automatically add the proper value for you (if you set the field up correctly). Hope this helps!
  19. I got it! <?php class ExampleClass extends phpLive{ public function __construct(){ parent::__construct(); } public function loadurl(){ $this->net->http->getHttp('http://google.com'); } } ?>
  20. I wouldn't do an include, I would do file functions $file = 'stories/20110504.html'; $handle = fopen($file, 'rb'); $content = fread($handle, filesize($handle)); fclose($handle); echo $content;
  21. I can not understand why this isn't working, basically it works in one place but not the other I have this in my main class: class phpLive{ public function loadCore(){ foreach(glob($this->location."/core/*/*.core.php") as $coreFile){ $info = (object)pathinfo($coreFile); require_once $coreFile; $pos = strrpos($info->dirname, "/"); $coreMedia = substr($info->dirname, $pos + 1); $className = str_replace(".core", "", $info->filename); $instance = strtolower($className); $this->$coreMedia->$instance = new $className(); } } } On the page that I run (index.php), I use this: $_live->example->loadurl(); which is in a class that looks like this: <?php class ExampleClass extends phpLive{ public function __construct(){ $this->loadCore(); } public function loadurl(){ $this->net->http->getHttp('http://google.com'); } } ?> and I get the following error: but, when I run this on the main page: $_live->net->http->getHttp("http://google.com"); The code works just fine. Why doesn't the first one work (the above is the actual code, copy and pasted from my editor)?
  22. Maybe it is just me, but a salt seems useless. asdfasdfasdf234s8jre45u30jgrg4u594jg09405g40j54oijgt4 asdfasdfasdffgrgjpwoijg4j5j4oit5j45[4509j509jgt59j43955t asdfasdfasdf45piowt5g945g05h56h955h9y596696hjboiere asdfasdfasdfwerf8sorj4458jrsrrtjo5jtierjtj84j5tejrtp8gjgjg48 If you are smart, you will notice that all of these have the same thing in common, they all begin with: asdfasdfasdf As long as you know to remove that, you can now decrypt it (if you know how). Maybe it is me, but am I going about that theory wrong?
  23. I am not sure why your doing this with a password: $site_secret.$nonce.$password could you explain yourself? I would recommended sha256+ I still use md5 for most of my stuff. I would have to say if you are storing user private data, you would want something with the best security possible. If your storing basic stuff, yeah security would be nice, but it almost doesn't matter if someone breaks in, what are they going to end up with? not much. I wouldn't write a something with that attitude in mind though.
  24. Give this a try: http://phpsnips.com/snippet.php?id=59
×
×
  • 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.