-
Posts
3,584 -
Joined
-
Last visited
-
Days Won
3
Everything posted by JonnoTheDev
-
Any books from the following publishers are usually the ones I stick to: Apress, O'Reilly, Sams Publishing Start with a beginners book rather than diving straight into OOP concepts. Search Amazon. Get the best deals from second hand books.
-
I dont know why you dont have it unless you have deleted the table.php file within /includes/modules/shipping/ Just downloaded the osCommerce files and it is included. You should be able to install it from the shipping link within http://www.yoursite.com/admin Are you using version 2.2 or one of the beta new releases 3/4
-
Matrix meaning a data array of two or more dimensions. For example the table rates are based on weight or price. If you were to use the price for shipping calculations you could add: So anything with a price of $0 will be charged at $0.00, anything upto $10 will be charged at $5.00 Or if the product has a price use weight as the quantifier and set the product weight to 0. If you require anything more complex then you will need to write your own module. Its not that hard. Use the flat rate class file as a template.
-
Use one of the matrix shipping tables then like table rate
-
[SOLVED] Restrict Upload File Type to MP3 Only
JonnoTheDev replied to sh0wtym3's topic in PHP Coding Help
Where in your code is this variable being set? $uploaded_type I cant see it at all -
For the functionality that you describe you could use a database table to store your sessions along with timestamps. You will need to add your own session functions and set your handlers with session_set_save_handler() Include a cleanup routine that will destroy sessions past their max lifetime. You could set a lifetime for periods of inactivity i.e. $sessionLife = 3440;
-
[SOLVED] Restrict Upload File Type to MP3 Only
JonnoTheDev replied to sh0wtym3's topic in PHP Coding Help
Bad Syntax if (!($uploaded_type=="audio/mpeg")) { Use if($uploaded_type != "audio/mpeg") { -
Yes. Add another field in your products table for a shipping flag. You can then use the flag in the shipping files to exclude or return as 0 if the product is flagged as no shipping.
-
Simple POST alternative to curl please
JonnoTheDev replied to johnsmith153's topic in PHP Coding Help
fsockopen() can do POST requests Try this one: http://swik.net/User:alex/Tips+and+Tricks/POST+in+PHP+without+cURL/eq2x -
PHP can connect to an mdb but it is not usually the preferred database. Users usually go with MySQL. Any server side language can perform this task: PHP, ASP, .NET, etc. It's up to you which you go with and I guess depends on if you want to extend your knowledge further. Since you are on a PHP forum you know what the users here will suggest.
-
You can tell you are in a rush! Read the errors carefully that are displayed to you on the screen: It is even telling you the file and line number!
-
[SOLVED] Trouble with link, returning 404?
JonnoTheDev replied to aebstract's topic in PHP Coding Help
Whats wrong with /prices/editmused/12/1/ -
When you install an app on a linux box from source you usually run the ./configure command to tell it what modules to compile with, paths to files, etc. Then the application is compiled using 'make' then 'make install'. Your phpinfo shows the original configure options that were used to build and compile php. However, additional modules can be installed later without the need to recomile php. You can do this with yum i.e. If I wanted to add the mbstring extensions I could use: yum install php-mbstring After restarting the webserver the module will show in your phpinfo but the configure line will not change.
-
$from should be an email address. You have not added the headers to the mail() function mail($recipient, $subject, $msg) Should be mail($recipient, $subject, $msg, $headers)
-
[SOLVED] Sum of one variable - can it be done?
JonnoTheDev replied to richrock's topic in PHP Coding Help
Then why not use the MYSQL SUM() function to get each users total -
Example mail() with headers for plain text: $from = "me@mydomain.com"; $to = "you@yourdomain.com"; $sub = "Test Message"; $msg = "This is the body of the email"; $headers = "MIME-Version: 1.0\n"; $headers .= "Content-type: text/plain;\r\n"; $headers .= "X-Priority: 3\n"; $headers .= "X-MSMail-Priority: Normal\n"; $headers .= "X-Mailer: php\n"; $headers .= "From: \"".$from."\" <".$from.">\n"; $headers .= "Reply-To: \"".$from."\" <".$from.">\n"; // send the email mail($to,$sub,$msg,$headers);
-
[SOLVED] Sum of one variable - can it be done?
JonnoTheDev replied to richrock's topic in PHP Coding Help
while ($rowsPaid = mysql_fetch_array($resPayments)) { $payment = $rowsPaid['pay_method']; $amount = $amount + $rowsPaid['amount']; } print "Amount: ".$amount; -
Try ammending the cookie path to your server tmp directory. Had no problems setting cookies with curl using this: $cookiePath = "/tmp/cookies.txt"; curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiePath); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiePath);
-
You are missing your mail headers. Look at the headers for email in the php docs http://uk3.php.net/manual/en/function.mail.php
-
Also long as you have a database connection open you can use it. If you are cleaning the data and then sending it back to the screen - lets say a user has forgot to enter their email address into your form but they have entered their firstname and lastname, you are not going to make the enter them again so you will send the cleaned data back to the user in the appropriate fields. However you probably dont want to escape data at that point as it will look funny to the user if like David O\'Leary, only when inserting into the database i.e. mysql_query("INSERT INTO table SET firstname='".mysql_real_escape_string($firstname)."'"); Having a Mysql wrapper class is always useful as you can implement this into a query method so data is always escaped.
-
This function is used for displaying data back to the screen as opposed to lets say inserting into a database: $data = stripslashes($data); If you are inserting the post data into a database table then you require mysql_real_escape_string() to escape any special characters
-
These are attributes for the node. When you are parsing the file do you need the attributes? If not most parsers should work OK as all they really do is convert the XML into a multi-dimensional array.
-
Not that much diff between the two. You may also want to make use of the strip_tags() function to prevent HTML posts
-
Are you not sending this value to paypal in a button to start with including the price and currency. The quantity may also be posted back in a variable. Check out the IPN docs. Possibly $_POST['qty'];