-
Posts
3,584 -
Joined
-
Last visited
-
Days Won
3
Everything posted by JonnoTheDev
-
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!
-
I wouldn't use file_get_contents() as it is slow. Checkout smarty and look at its internals http://smarty.net
-
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
-
What INSERT/UPDATE queries. There are none!
-
Correct, but refreshing the page will not achieve this. You need a proper procedure.
-
printers dont work like that!
-
mysql_connect is fine. you do not need persistent connections.
-
Can't seem to get mysql extensions working
JonnoTheDev replied to Tim356's topic in PHP Installation and Configuration
Use yum: yum install php-mysql service httpd restart -
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) { } ?>
-
[SOLVED] Frustrating PHP + MySQL- Unknown Character
JonnoTheDev replied to SamW's topic in PHP Coding Help
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']; -
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
-
FTP the file after writing. Look at the ftp functions in the php manual.
-
[SOLVED] Frustrating PHP + MySQL- Unknown Character
JonnoTheDev replied to SamW's topic in PHP Coding Help
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 ); -
replace with require(dirname(__FILE__)."templates/my_blog_v2/suckerfish.php");
-
http://www.digitalpoint.com/tools/keywords/
-
http://www.googlerankings.com/
-
simple answer, yes.
-
Post the code from line 165
-
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?
-
security question: please have a look at the code
JonnoTheDev replied to toffler's topic in PHP Coding Help
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) { } -
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');
-
Please Crqtique my site - would love any and all input good or bad
JonnoTheDev replied to yoojin's topic in Website Critique
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. -
Look at the file functions for php and the examples http://uk3.php.net/manual/en/function.fopen.php
-
Install this package and read the documentation. Use your ISP's SMTP server. http://pear.php.net/package/Mail/
-
Easy enough to make this yourself