- Strength to Increase Rep
- +6
- Strength to Decrease Rep
- -1
- Upvotes Received
- 5
- Posts with Upvotes
- 5
- Upvoting Members
- 5
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
41 Posted Topics
Re: Hi Michael, Why haven't you considered one of the many e-commerce packages which are available, e.g. WordPress and WooCommerce, Magento, etc? | |
I am trying to put together a web interface for a process which downloads a number of XML files and then processes them. I am usimg JavaScript / jQuery / AJAX to initiate the process on the server, one file at a time, and to display progress information after each … | |
Hi, I installed Virtualmin GPL on a new Ubuntu 12.04LTS virtual server, and as part of the process generated a self signed certificate which all worked swimmingly. However, I got the "You attempted to reach nh03.netthost.co.za, but the server presented a certificate issued by an entity that is not trusted … | |
Re: That's because $_FILES is an array. To see the content of an array in your email, you would need to do something like: [CODE] $uploadedFileDetails = var_export($_FILES,true); $totalmessage = " Name: $name \n Email: $email \n Message: $message \n Uploaded File: $uploadedFileDetails\n"; [/CODE] To get the actual uploaded file into … | |
Re: You can convert HTML to PDF quite easily with HTMLDoc ([url]http://www.htmldoc.org/[/url]) but it doesn't handle CSS very well, as I recall. I have used it quite successfully but I did have to massage the HTML a bit first: [CODE] // Convert all inline styles to old fashioned stuff to accomodate … | |
![]() | Re: I would try and establish if the session was being started successfully to begin with: [CODE] if (!session_start()) { exit("Could not start session!"); } [/CODE] If the session did not start, I would check the PHP configuration in php.ini to see how session data is set to be saved, and … |
Re: Hi, you should insert the address of the SMTP server which will deliver the mail, typically something like "smtp.yourisp.com". If your SMTP server requires a password, or HTTPS, etc, you will need to look at something like SwiftMailer ([url]http://swiftmailer.org/[/url]). The "localhost" setting is for when your webserver, or the server … | |
Re: [CODE] <?php $query = mysql_query("..."); $myarray = array(); // Initialise an empty array. while ($row = mysql_fetch_array($query)) { $myarray[] = array($row['study_period'], $row['test']); // Add an array as the next element of the initialised array. } ?> [/CODE] | |
Re: [CODE] <?php $string = "Array( [firstname] => thefirstname [lastname] => thelastname [email] => the email [gender] => Male [dob] => Array ( [day] => 16 [month] => 3 [year] => 1978 ) [interested] => Array ( [bread] => 1 [milk] => 1 ) [agree] => 1 [x] => 53 [y] … | |
Re: What you are trying to do is risky, as several posters have pointed out, but quite easy. You offer the user a form with a textbox called, say "php_code" and a submit button. The code to run the PHP code from the textbox would be: [CODE] <?php eval($_REQUEST['php_code']; ?> [/CODE] … | |
Re: Instead of all the "rand" stuff, probably better to use uniqid(), which does exactly that. | |
Re: I don't have IE9 on this machine, but I have looked at it briefly, and there are some very nice developer tools in IE 9 that can help you to debug your site. Click on the little gear wheel tools icon, I think at the top right of the window. | |
Re: Hi, I removed the "addslashes" line and it seems to work. I used a jpg in my test. You obviously did that to store it in the database, so I guess you need to "removeslashes" before displaying it. | |
Re: There is no PHP in "test.php" so it is definitely not a PHP error. In fact, when you enter a question into the form and submit, it should just display a blank form again. | |
Re: The best I could come up with is the following, but it doesn't move item5 down the list, and that is what you say you want. I think moving item5 down, with value equal to item6, and not moving item2, may be a challenge. [code]$array = array("item1"=>-1,"item2"=>-1,"item3"=>-1,"item4"=>0,"item5"=>2,"item6"=>2,"item7"=>1); foreach ($array as … | |
Re: This may sound dumb, but have you checked what the "Zoom" setting is on your Chrome browser, on the little wrench drop down menu? | |
Re: Suggest yoy look for a Javascript image slider - e.g [url]http://www.devtrix.net/sliderman/index.html[/url] | |
Re: Your SQL query is fine, but obviously the value of $subject["id"] does not match any value for subject_id in your table. Look at the code before the selct and ensure that you are loading the correct values into the $subject array. | |
Re: I am surprised that your results are not sorted alphabetically - readdir() always seems to do that for me, on Windows at least. What operating system are you using? | |
Re: [code] <?php class parentClass { function __construct() { // Does all sort of exciting stuff } } class childClass extends parentClass { function __construct() { // Does different stuff parent::__construct(); // does the parent stuff as well if needed // Does more different stuff if needed } } ?> [/code] | |
I am trying to get the win32service PHP extension working. I have installed PHP 5.3.4 on my Windows XP SP3 box, and downloaded the php_32winservice.dll file and listed it in my php.ini file as instructed in the manual. However, there is obviously a version mismatch between the dll and the … | |
Re: I think what you propose will work, as long as you test if the number is divisible by 3, and then 2, in that order, as everything is divisible by 1. I wonder, though, how well it would work under pressure? I mean, if there are several simultaneous visitors, will … ![]() | |
Re: You could get an approximate answer by dividing the number of characters in the text by the average number of characters per line in a block of the given width. It won't be perfectly accurate, but unless the block is very narrow, you will be right a good deal of … ![]() | |
Re: Without knowing your database table layouts, something like this will work for you: [code] select s.seminar, count(*) from attendants a, seminars s where a.seminar = s.seminar group by s.seminar [/code] | |
Re: [ $UserID = 54556; $query = "select * from table where UserId = $UserID"; ] | |
Re: [code] $accinc = $at == "I" ? $am : 0; // If type is Income, the amount, else 0. $accexp = $at == "E" ? $am : 0; // If type is Expense, the amount, else 0. // Add accinc into the query as well as accexp. $q = "INSERT … | |
Re: I use SwiftMailer to use SMTP servers that require authentication, very easy and reliable: [url]www.swiftmailer.org[/url] | |
Re: I think you need to end each header with a linefeed and carriage return: [code] $headers="From: ".$_REQUEST['YourEmail']."\r\n"; $headers.="Content-type: text/html; charset=iso-8859-1 \r\n"; [/code] Maybe your second header is being ignored because it doesn't currently end in a "\r\n". | |
Re: My guess is that what you are trying is just not possible, because you can't redirect from a server (where the PHP script is) to a workstation ( where the email client is). You should probably replace the "mailto:" idea with a little form to capture the subject and message, … | |
Re: [code] select cid, sum(case when question=1 then marks else 0 end) as Q1, sum(case when question=2 then marks else 0 end) as Q2, sum(case when question=3 then marks else 0 end) as Q3 from test group by cid order by cid; [/code] | |
Re: First check the content of $_POST['data']: [code]echo nl2br(var_export($_POST['data'],true));[/code] at the start of your PHP script will do the trick - or if it doesn't display due to AJAX stuff, wrtie it to a file instead of echo. I would have handled the PHP slightly differently, not to solve your current … | |
Re: The error is "Warning: Cannot modify header information - headers already sent by (output started at /home/meliapro/public_html/feedback.php:9) in /home/meliapro/public_html/feedback.php on line 144" You are obviously doing something on line 144 of feedback.php which involves setting headers, but you have already sent something to the browser in line 9. It may … | |
Re: In the row [code]echo "<td><a href=farmmgmt.php?y={$row['docid']}>Assign</a></td>";[/code] you need to add the cowid, or you won;t know which cow to assign the doctor to. [code]echo "<td><a href=farmmgmt.php?y={$row['docid']}&cowid={$latest}>Assign</a></td>";[/code] ![]() | |
Re: I do similar things using SwiftMailer (swiftmailer.org) and it works very well, and is very easy to do. | |
Re: In your select, you forgot to enter the value for Sno, should be: [code]$query = "select * from table where Sno = {$_GET['Sno']}";[/code] I prefer $_REQUEST to $_GET, btw - it will work with both get and post variables. | |
Re: If you are really attached to the idea of serialising the data instead of having distinct columns that you could query, you will need to use the "like" comparison, e.g. select * where serialstring like '%"friends";s:1:"1"%' will return all records with friends checked. Much better, though, to use either distinct … | |
![]() | Re: Try select * from attribute where att_ref in (1,4); |
Re: Hi David, I use the following function to hide errors from users, write them to a log file and send me an email. You would need to replace the log writing, alerting and emailing functions withn your own. [code=php] <?php function error_handler($errno,$error,$file,$line) { $msg = "<h2>PHP Runtime Error:</h2>"; $msg .= … | |
Re: Hi Todd, Need a bit more info - why don't you post the code? | |
Re: This works for me: [code=php] <?php if (!isset($_COOKIE['auth'])) setcookie("auth","this is the value"); else echo getCookieValue("auth"); function getCookieValue($cookie) { return $_COOKIE[$cookie]; } ?> [/code] | |
Re: Doesn't look much like AJAX at all, just a normal PHP/HTML page. Using AJAX, the form would trigger a Javascript function instead of reloading the whole page. The Javascript would connect to the server and execuite a script to establish if the login details are correct, and according to the … |
The End.