- Upvotes Received
- 14
- Posts with Upvotes
- 13
- Upvoting Members
- 14
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
98 Posted Topics
Re: Using $return in the view is the correct syntax as Codeigniter creates variables based off the array key names of the array you pass to the view() call. Except why are you using `$this->template->show()` instead of `$this->load->view()`? Two other things. 1) **return** is a PHP reserved word and it's bad … | |
Re: Unless you have defined a `printpage()` function in JavaScript, that button will not do anything. Your <img> tag uses the right code `window.print()`, you could change the button to use the same thing: <input type="button" value="Print this page" onclick="window.print()"> As for problems with a dot-matrix printer, those aren't going to … | |
Re: Files don't have mime types, there are two factors: The file extension, and the header in an image file that contains information about the image type. I assume you're referring to the latter? If the image is actually a jpeg ( http://www.php.net/manual/en/function.exif-imagetype.php can tell you ) then saving it as … | |
Re: Just to add about why exactly your code isn't working: 26. if ($newPassword == $conPassword) { 27. $sql = "UPDATE user SET password = '$newPassword WHERE user_id = $user_id"; 28. if($sql) 29. { 30. echo 'password successfully changed'; 31. } 32. else{ 33. 'new password and password must be the … | |
Re: You can't use anything on a session for 8 days. It'll expire as soon as the user closes the browser, or at the session expire limit. When you say the user submits a form containing title, description, and user id: How is the user id generated for temporary users? I … | |
Re: Make something related to your interests. A couple ideas would be a browser-based game, a social networking site, a forum... How many years have you taken and what level of experience do you need to show? | |
Re: As far as emailing an attached file, this isn't the greatest of scripts but here is an example: http://www.shotdev.com/php/php-mail/php-send-email-upload-form-attachment-file/ | |
Re: This is the relevant code that we need to see: 559.function ogluu_sendmail($to, $toName, $subject, $body) 560.{ 561. require_once(DIR_FS_INCLUDES . "phpMailer/class.phpmailer.php"); 562. 563. $mail = new PHPMailer(); 564. $mail->AddAddress($to, $toName); 565. $mail->SetFrom('support@ogluu.com', 'Ogluu'); 566. $mail->Subject = $subject; 567. $mail->Body = $body; 568. 569. $mail->IsSMTP(); 570. $mail->SMTPAuth = true; 571. $mail->Host = … | |
Re: The open_dir and related functions are for working with a local filesystem. To access something on a remote server, you're better off looking into an FTP connection to achieve the results you're looking for. See documentation here: http://www.php.net/manual/en/book.ftp.php | |
Re: Your notice says index1.php instead of index.php. Is this a new file you've created, or the same as index.php but just renamed? | |
Re: Three parts to what you'll need: 1) http://us2.php.net/manual/en/function.setcookie.php to set the cookie 2) http://us2.php.net/manual/en/reserved.variables.cookies.php for reading the cookie value 3) To do a redirect from PHP you have to use header like this: `header("Location: http://" . $city . ".example.com");` Or for JS: `echo "<script type='text/javascript'>window.location.href = 'http://" . $city . … | |
Re: Just to clarify, you want to print the report on the client side? You cannot print from a PHP server to a printer attached to a user's computer directly. If you want to do that you need to send the file to the user's browser with a JavaScript command `window.print()` … | |
Re: GROUP BY isn't intended for use like this, it's supposed to be used with a MySQL function like COUNT() or MIN() to return information about a resultset from multiple rows. If you want everything sorted by publisher name first, then by time, you simply need to run the query ordered … | |
Re: I don't have exact numbers to Isreal but you can try speedtest.net/pingtest.net and see if you can find a server there for reference numbers. Ping from West coast to East Coast of US is ~100ms, from East Coast to Europe is another ~100ms. I have a friend who lives in … | |
Re: To determine the level of work actually required you need to determine what pages and features you need, as the cost can range dramatically. Example you're talking about a Nutrition Information System, your requirements should include something like this: * Database containing nutritional information(calories, fat, trans fats, saturated fats, carbs, … | |
Re: A note about PHP_EOL, it sets the line endings to what is correct for the current server, not necessarily the client computer. Meaning if you're on a windows computer and you view a file with PHP_EOL line endings generated from a Linux server, it'll all be on the same line. … | |
Re: I'm not sure exactly why you have 300% width specified on your header, and 300% height specified on a couple other things - Perhaps you mean 300px? Also you use <header> <nav> and <aside>, are you intending to use those as divs? (e.g. <div id="header">) | |
Re: The problem is right now you only run the search query if the form data has been submitted, see lines 16-20: if (isset($_POST['formsubmitted'])) { 17. $hi = $_POST['hi']; 18. $result = mysql_query("SELECT * FROM birds where species='$hi' ") 19. ; 20. } And when the user clicks your link, all … ![]() | |
Re: Unless the sites you want to search offer an API, you have to probably use CURL to send the request to their search form, then use a regex parser to sort out the links in the result. Or you can look into a Google custom search box. | |
Re: The display of "Array" is a clue as to what is actually happening here: 76. foreach ($_POST as $key => $val) { 77. $message .= ucwords($key) . ": " . clean($val) . "\r\n"; 78. } The loop here loops through all the form elements and adds them to the email. … | |
Re: For starters I would change your email statement a bit as currently it will result in you passing a boolean variable to mysql_real_escape_string(), which isn't really what that function is intended for. Try moving it to around stripslashes like this: $email = (isset($_POST['email']) ? mysql_real_escape_string(stripslashes($_POST['email'])) : false); $password = (isset($_POST['password']) … | |
![]() | Re: Not sure if this is exactly the issue but it appears your 3rd and 4th paramaters are backwards. See http://us3.php.net/manual/en/function.mail.php `bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )` $message should go before $headers. If you think $mrow['email'] is the … ![]() |
Re: At first glance nothing looks immediately wrong, what errors are you getting? One big thing for security and some functionality purposes, however, is that you're using unsanitized form data in your SQL queries. Meaning you're putting the data from $_POST straight into the query. This is a major no-no, you … | |
Re: Facebook-style notifications revolve around the concept of "following" a post, which is done automatically when a user either A) Created the post, B) Likes the post, or C) Comments on the post. I'm sure there's a more efficient way to do this but the simplest I can think of is … | |
Re: Assuming your connection doesn't run in config.inc you need to fill in the mysql_connect() in the above code with the variables from the file, for instance: `mysql_connect($host, $user, $password) or die(mysql_error());` Also this bit of code is backwards again: 11. $agree_date = $rows['agree_date']; 12. 13. $rows=mysql_fetch_array($result); You fundamentally cannot use … | |
Re: When your form is method='get' any get variabhles within the action url will be overriden. What you have to do is make a hidden input field to pass it through, like so: `<input type='hidden' name='id' value='$id' />` Also in your script you really need to sanitize the form data before … | |
Re: PDO is great, but to answer the original question: The key to fetching and updating a specific set of data (For instance user #11) is exactly that, fetching the data for user #11. Usually this is done with a user_id column in your database table. What you will have to … | |
Re: Given: 1) You have a column named 'friend_ids' which contains a comma-separated list of friend IDs, like so: "1378,1892,461,1781". 2) Your posts table uses user_id as a column to identify who made the post. 3) You have a local variable named $user_id that holds the id of the current user … | |
Re: Yeah I believe diafol is correct. Look at your own script above: `<?php if(@$query2){echo htmlentities(@$ptotal['ptotal']);} ?>` After you run this code: $query2=mysql_query("SELECT ptotal FROM personal"); $ptotal=mysql_fetch_array($query2); The value in $ptotal is not a number, but an array containing two key/value pairs: 0 => (value of ptotal) 'ptotal' => (value of … | |
Re: In this code: `$tariff = mysql_query("INSERT INTO ebvouchertariffs ( TariffSlNo, TariffDate)", $link );` Where is your `$link` variable coming from? It appears you are discarding all of the values submitted via the $_POST array, or at least not using them in your database. To help you with writing a query … | |
Re: Are you looking for Pagination? Pagination is where basically if the number of rows exceeds X (for instance 30) only 30 rows will be displayed, with a link below to view the next 30 rows, and so on. Similar to how threads in this forum work. | |
Re: I have to add to this that you **need** to sanitize all HTML form data before using it in a query, to prevent both accidental errors and deliberate hacking. Specifically here: $basic = $_POST['basic']; $allowance = $_POST['allowance']; Should be: $basic = mysql_real_escape_string($_POST['basic']); $allowance = mysql_real_escape_string($_POST['allowance']); Since these are number fields … | |
Re: Your problem starts from not passing a valid $conn handle to your mysql_select_db function, which then causes your subsequent query to fail. This traces back to your mysql_connect() statement pzuurveen mentioned. It should look something like this: `mysql_connect($host, $user, $password) or die(mysql_error());` This way if there is any error, the … | |
Re: To access files on a remote server, your best bet is probably the FTP extension. The general filesystem functions only work with your local server/an HTTP request to a remote server, which won't give you the level of functionality you're looking for. http://php.net/ftp ![]() | |
Re: Indeed your question doesn't give us a lot to work with. Perhaps you're trying to take the contents of a MySQL table and display them in an HTML table? | |
Re: Poster above me has the right idea but to clarify-- Lines 1-49 in your code are only relevant if the user uploaded a file. And the problem is that in that section of code, there are four image-upload related places where the script will exit if there are any issues … | |
Re: Your AJAX call is sending the request like this: 19. XMLHttpRequestObject.open("GET","getcitylist.php?state_id,city_id="+state_id,+city_id,true); It looks like you're trying to separate the variables in the URL string with a comma and then add the values after, but you need to do them individually. When you are passing paramaters via the GET method, they … ![]() | |
Re: Bypassing a deactivated link of another site to get to its content would be hacking, which isn't something discussed here. If you would like to replicate this effect in a site you're developing we can provide examples of how to do this as minitauros did. In essence there are two … | |
Re: Why are you setting your SMTP server to Yahoo.com? If you're trying to use their mail server to send your mail then it's highly possible they're blocking it as they have external mail access blocked except for premium users I believe. | |
Re: To my knowledge CURL and mail() operate independently of each other as mail() uses whatever SMTP server is defined in your php.ini. The only way to really go about securing an email is to encrypt the contents - I haven't done this personally but it looks like the popular solution … | |
Re: Guys to expand on what <M/> was saying as it might not be clear, OP made this thread over a year ago so replies to the original query are no longer relevant. | |
Re: There are a couple ways you can do this, both involve placing the four tables in a container. 1) Make the container as big as the screen, add `position: relative;` to it. Then on each of your tables add `position:absolute;` and use top/left/right/bottom to define their spacing from the parent … | |
Re: Your code for index.php and retrieve.php seems to be the same script. Also the link points to retrievepass.php but you don't have a file by that name listed. If you post the relevant code we can take a look. | |
Re: Those numbers from the database are MySQL data type specifications, they have nothing to do with the HTML table display. The look of your end webpage is controlled only by HTML and CSS, which will be found in one of three locations: * Inline style attribute in the HTML tags … ![]() | |
Re: Also this isn't as much related to your original post but I noticed this or something similar appears in almost all your functions: $res = mysql_query($sql); mysql_query($res); I'm not entirely sure what your logic is here but this is essentially calling mysql_query() once to run an SQL query, and then … | |
Re: I'm guessing the previous poster slightly misunderstood. You will have variables like $name and $address in the script, correct? And anywhere the user enters <name> you want to put $name in there? str_replace is the way to do it. [code=php] $name = "John Smith"; $raw_message = $_POST['message']; $message = str_replace("<name>", … | |
Re: If you're looking for the form to change without reloading the page, you need JavaScript. Go here: [url]http://www.daniweb.com/forums/forum117.html[/url] Edit: You may also find this useful: [url]http://answers.google.com/answers/threadview/id/208742.html[/url] | |
Re: Yes, just separate further variables with & instead of ?. subcategory.php?id=1&category=drivers&type=3 Sidenote: As usual, don't forget to properly sanitize any get/post input you're using with the database =) | |
Re: You may already be thinking of this, but one idea is to make two timers. One is a PHP timer(as described above, using dates or timestamps). Two, if you want to enhance the user's experience, make a JavaScript timer [b]as well[/b], which doesn't alter the user data in any way … | |
Re: If you're doing form processing, e.g: user submits form from PHP1.php and PHP2.php echoes "Hello (name)", then you'll want it like this. Form on PHP1.php [code=html] <form action='PHP2.php' method='post'> Name: <input type='text' name='name' /><br /> <input type='submit' value='Submit' /> </form> [/code] Script on PHP2.php [code=php] <?php if(isset($_POST['name'])) { echo "Hello … |
The End.