Jump to content

JonnoTheDev

Staff Alumni
  • Posts

    3,584
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by JonnoTheDev

  1. Can be done with mysql / php. 1. When a user clicks on their profile pass a parameter in the url to identify the users database record i.e the primary key: profile.php?id=123 2. Validate the parameter to make sure it is the correct data type and format (not manipulated) 3. Connect to the database and select the record using the url parameter SELECT * FROM user WHERE id='123' 4. Print the data to the screen Simple!
  2. I wouldn't use file_get_contents() as it is slow. Checkout smarty and look at its internals http://smarty.net
  3. A printer will output the data sent to for its given paper size. i.e if you print 3 lines on an A4 printer it will spool the whole page not stop and wait for you to print again. i.e. A system flow 1. Collect data 2. Does length of data match paper size 3. No: reset to 1 4. Yes: print 5. Unset data
  4. What INSERT/UPDATE queries. There are none!
  5. Correct, but refreshing the page will not achieve this. You need a proper procedure.
  6. printers dont work like that!
  7. mysql_connect is fine. you do not need persistent connections.
  8. Use yum: yum install php-mysql service httpd restart
  9. This code is horrid! It is a mass of duplication and if you are using php version > 4.1 you should not be using $HTTP_POST_FILES You can do this using 1 block of code within a loop for all pictures. Finish the rest off: <?php // we will hold all filenames here $picures = array(); for($x = 1; $x <= 6; $x++) { $fieldName = 'pic_'.$x; if(isset($_FILES[$fieldName])) { switch($_FILES[$fieldName]['type']) { case "image/gif": $ext = ".gif"; break; case "image/pjpeg": case "image/jpeg": $ext = ".jpg"; break; } if(strlen($_FILES[$fieldName]['name'])) { if(is_uploaded_file($_FILES[$fieldName]['tmp_name'])) { // path and filename $filename = $fieldName."_shops".$next_id.$ext; $filePath = $cfg_pics_path.$filename copy($_FILES[$fieldName]['tmp_name'], $filePath); unlink($_FILES[$fieldName]['tmp_name']); // add the picture to the array $picures[$x] = $filename; } } } } // loop through pictures and add to database foreach($pictures as $num => $filename) { } ?>
  10. aviavi, mysql_fetch_array() will not return associative keys therefore your code wont work // bad $row = mysql_fetch_array($result); // this index will not exist print $row['content']; // good $row = mysql_fetch_assoc($result); print $row['content'];
  11. This requires a database with tables to store titles and episodes - episodes relate to titles. Video filenames are stored within the episode record. You need to learn mysql & php functions: 1. How to pass and use url parameters (the title id and episode id) 2. How to connect & select records from your database using the url parameters 3. How to validate url parameters Learn from some beginner php tutorials (use Google). There is no script to download that will acheive what you want and if there is it will be more difficult to fine tune to your needs. Your functionality spec is fairly basic and not difficult to make. Will require max 2 pages: 1. Display titles, select title, display episodes, select episode 2. Display episode video
  12. FTP the file after writing. Look at the ftp functions in the php manual.
  13. The value will not be contained in the array as you are selecting the result set prior to inserting the record. swap the queries around. Should also be an associated array if you are using the field key. mysql_query("INSERT INTO cms (content) VALUES('$content' ) ") or die(mysql_error()); $result = mysql_query("SELECT * FROM cms") or die(mysql_error()); $row = mysql_fetch_assoc($result );
  14. replace with require(dirname(__FILE__)."templates/my_blog_v2/suckerfish.php");
  15. http://www.digitalpoint.com/tools/keywords/
  16. http://www.googlerankings.com/
  17. simple answer, yes.
  18. Post the code from line 165
  19. Please post you login code and the script that allows users to view prices once logged in. Also, do you have a proper database design i.e users, pricelists, users to pricelists tables?
  20. Fairly straightforward. If the session is not set the user is redirected to login. This is fine. One point is the use of global variables. This is bad practice. Do not use them in functions. Functions should accept parameters: // bad function login() { global $post, $get; } // good function login($request) { }
  21. The error basically states that one of your php files settings.php is trying to include other files within the script however the path to the file it is trying to include is incorrect! You must change the path within the require() function on line 165. Use the full server path rather than a relative path i.e. require('/hsphere/local/home/seshamaru/vanadielprofiles.com/templates/my_blog_v2/suckerfish.php');
  22. The websites are all made purely in flash. Bad, bad move! 1. They are inaccessible to any user that doesn't have flash installed. This may include users who make use of certain browsers due to a disability i.e. visually impaired, etc. You should provide an alternate HTML version that is accessible. 2. Search engines cannot index flash. If you are promoting a service via your website then you will struggle to get any results from keyword searches. Again you should create HTML versions that search engines can spider. 3. The websites do not fit in a lower screen resolution. The banner (from the left) sits directly above the main content area. This is poor. IMO websites should not be made purely using flash. You are making the website inaccessible to a massive number of Internet users. Integrating small areas of flash to spice them up is fine.
  23. Look at the file functions for php and the examples http://uk3.php.net/manual/en/function.fopen.php
  24. Install this package and read the documentation. Use your ISP's SMTP server. http://pear.php.net/package/Mail/
  25. Easy enough to make this yourself
×
×
  • 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.