363 Posted Topics
Re: Why is the `charset` part of all `Content-Type` headers empty? You should either leave the charset out and let email clients/browsers fall back on their defaults, or provide a charset. If you're not sure which charset you want to be using, UTF-8 is a good choice. By the way, all … | |
Re: Hey. That first code is written in a rather bad way. Extracting the contents of an array into variables is not a good idea. There was initially a feature in PHP that always did this for REQUEST variables, called [register_globasl](http://php.net/manual/en/ini.core.php#ini.register-globals), but it's since been removed because, well, it wasn't really … | |
Re: Hey. Consider this: [i](I wrapped the code into a complete HTML structure just to demonstrate how it *should* be structured. I assume you will have to pull it apart and put it into your own page.)[/i] [code=php] <?php // Its best to get most of the PHP stuff out of … | |
Re: A few things you can check out: [list] [*]What's happening in your [icode]From:[/icode] header? Why do you have two email addresses crammed into the <> brackets there? - You [i]can[/i] use multiple addresses, but they must be formatted the same way the [URL="http://php.net/manual/en/function.mail.php"]mail() manual entry[/URL] explains the [icode]to[/icode] field must … | |
Re: [QUOTE=HasNor;1744461]My point is want to insert the selected checkbox value into the same database row. Example : one,three --> if there are selected. [/QUOTE] I think it's worth pointing out that this is a very bad idea. The first rule of relational database design is to: Never store repeating groups … | |
Re: [QUOTE=cwarn23;1042550]A person who dehashes info isn't always a criminal.[/QUOTE] De-hashing is never illegal. The only illegal things about dehashing classified info would be the way they obtained to original hashes, or the way they used the info once dehashed. The act of dehashing the info itself is not illegal at … | |
Re: Look what happens if I fix the indentation of your code: [code] <?php //session session_start(); //login check function function loggedin() { if (isset($_SESSION['username']) || isset($_COOKIE['username'])) { $loggedin = TRUE; return $loggedin; } if (!loggedin()) { header("Location: index.php"); exit(); } } if (isset($_SESSION['username'])) { $loginusername = $_SESSION['username']; } else if (isset($_COOKIE['username'])) … | |
Re: Hi. This is an example of a simple MVC application, just to give you an example of how it can be done. I don't write out the base classes... no point really in this sample. [code=php] <?php /** * File: index.php */ /* This assumes a file structure of: * … | |
Re: Hey. Sorry to say, I can't really help you with the loading of the DLLs into PHP. However, I can offer a suggestion as to how you can work around this problem. PHP can execute shell commands, via the [url=http://php.net/manual/en/ref.exec.php]execution functions[/url], so you could always write a wrapper-script around it … | |
Re: That is typically done by logging the time when a given user (or a guest, if you want that) was last seen. Once a user hasn't been seen for some predetermined amount of time, he is considered off line. This is really the only reliable method, given the stateless nature … ![]() | |
Re: Hi. I see two simple ways to do that. First, you could simply use the [URL="http://php.net/time"]time()[/URL] function to get the current time stamp and add that to the image name. You could even prefix it with a random number to reduce the chance of a collision. Or, you could simply … | |
Re: Hey. The [icode]preg_replace[/icode]function would be better for that. The [icode]preg_match[/icode]function is used to search a string, not change it. (Not directly at least.) You would have to create a regular expression to search for you image tag, capture the contents of it, and use that to create a new version … | |
Re: Hey. [QUOTE=eshko;1046692]*pub_date is in PHP time() format. Example: 1258150430[/QUOTE] It is generally better to use MySQL's [url=http://dev.mysql.com/doc/refman/5.1/en/date-and-time-types.html]DATE and TIME types[/url] to store date or time. Easier to work with it that way. Anyhow. You can either fetch all the data at once and have PHP format it, or you can … | |
Re: You want this to run on your server infinitely, without anybody having to actually execute it? I would suggest one of two things: [list=1] [*]Use your Operating-System's tasl scheduler to execute it at startup. For Linux servers that would be [URL="http://en.wikipedia.org/wiki/Cron"]Cron[/URL]. For Windows it would be the [URL="http://en.wikipedia.org/wiki/Task_Scheduler"]Task Scheduler[/URL]. For … | |
Re: Hey. You could use Javascript to process the the form for you. Something like this should do it: [code=javascript]function SubmitForm(pForm) { var getString = ""; var elems = pForm.getElementsByTagName('input'); for(var i = 0; i < elems.length; i++) { if(elems[i].value != "") { getString += encodeURIComponent(elems[i].name) + "=" + encodeURIComponent(elems[i].value) + … | |
Re: Hey The [icode]<marquee>[/icode]tag is not a valid (X)HTML tag, which is why your IDE [I](Visual Studio, I assume)[/I] tells you it is not supported in XHTML. It's an old IE tag that was never accepted into the standards. [quote]ut it gives jscript error as System.Argument Exception as value for controls … | |
Re: Hey. You can try something like: [code=text]<FilesMatch ".*(?<!gif|png|jpeg|jpg|js|css|xml)$"> SetHandler application/x-httpd-php </FilesMatch>[/code] The extensions list in the regexp are those who should [I]not[/I] be interpreted as PHP. | |
Re: Hey. Your RewriteRule looks like it should work. Can't see a reason why it shouldn't at least. If you print the [icode]$_GET['keyword'][/icode] in the index.php file, you get the right value, right? The code, however, doesn't look quite right. Try removing the trailing [icode]";[/icode] from line #5. See if that … | |
Re: Hey Alice. Are you sure PHP is providing them with values in the first place? Check the actual HTML sent to your browser. Make sure the values are there. Also, one thing that jumped at me when I read that. Your hidden inputs are named "form1" and "form2", but you … | |
Re: We would need to see the code to be able to offer any real help. Void of that, I can do little more than direct you to the [url=http://php.net/]PHP manual[/url]. You could start by looking over the [url=http://php.net/manual/en/ref.datetime.php]Date/Time Function[/url] section. | |
Re: Typically, you store the data in your database and insert it into a HTML template. You don't actually store the HTML with the data. This does NOT include HTML that is actually a part of the data. Like, if a comment section of a blog allows users to use HTML … | |
Re: [QUOTE=kiranhg.2008;1047039]Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\kregpho.php:2) in D:\xampp\htdocs\kregpho.php on line 72 can any 1 tell me wat this error mean....y should it occur.[/QUOTE] It means that you use a header function [I](header(), setcookie(), session_start(), etc...)[/I] after you started sending content. After you … | |
Re: Hi. Try removing the "ssl://" from the host URI. The PHPMailer code should add that for you in the background. ![]() | |
Re: Hey Mike. To get your current code to only show the city you are hovering over, you need to have AJAX send the index of the city to the PHP file, and have PHP only return the data for that city. Your code is almost there, actually. There are only … | |
Re: [QUOTE=tryingtofindout;1146116]i hope u understand!!![/QUOTE] Doubtful, but I'll give it a try... If I am reading you correctly, you want the user to select a location from a HTML form and submit that location to a PHP page. On that PHP page you want an engineer name (presumably to be found … | |
Re: Hey. If I am not mistaken, RFC 2822 is an old standard that defines the structure of an email. If you error has anything to do with this standard, it would be that your code doesn't comply to it. Anyways, we can't really help you much without seeing your code. … | |
Re: Hey. You want to scan the <link> and <script> tags in the HTML <head> tag to see if there are resources missing? - If so, the sure. That is most definitely possible with PHP. We would need to know more about your code, though, to be able to give you … | |
Re: If you can't even be bothered to comply with the guidelines you agreed to when creating your account, or even the simple requests written all over the page where you wrote your posts, why would I want to help you? You get what you give, which in this case is … | |
Re: Hey. I see you print the type of the file at the top of the script. Is it the same for both versions? You could go one step further and just check the header of the files themselves. All valid PDF files should start with [i]"%PDF"[/i], so you could just … | |
Re: Hey. You forgot to close the string on line #6 of what you posted. [CODE] `location` LIKE '%$keyword%'[COLOR="Red"]"[/COLOR]));[/CODE] [i](The red " is the one you forgot)[/i] | |
Re: Hey. How does the class for your [icode]$session[/icode] variable look like? Without knowing that, there is really no way for us to tell what your problem may be. I do, however, suspect your friend meant the code to be used somewhat like this: [code=php] <?php if($session->logged_in) { echo "Hi, {$session->username}"; … | |
Re: Harsh Bavaliya, why do you manually loop through the strings like that? PHP comes with a number of [url=http://php.net/manual/en/ref.strings.php]String functions[/url] that can take care of all of that for you. [i](The [icode]str*[/icode], [icode]trim[/icode] and [icode]explode[/icode] functions, in particular, would be useful in this case.)[/i] Anyhow, this is how I would … | |
Re: Have you tried printing the actual query your code is executing, just to see if it is like you expect it to be? [code=php] $sql = "SELECT * FROM `userinformation` WHERE ..."; echo "<pre>$query</pre>"; $query = mysql_query($sql); [/code] Also, I would question whether you should use [icode]htmlspecialchars[/icode]on the value of … | |
Re: Hey. Perhaps: [code=php] $referrer = str_replace('&action=login', '', $_SERVER['HTTP_REFERER']); [/code] | |
Re: Hey. You would probably be safest using [url=http://en.wikipedia.org/wiki/SQL_injection#Parameterized_statements]Parameterized Statements[/url]. That way the database driver itself secures the input and makes sure it doesn't contain characters that would mess up the query. For example, using the [url=http://php.net/mysqli]mysqli[/url] extension. [i](Taken from Wikipedia)[/i] [code=php] $db = new mysqli("localhost", "user", "pass", "database"); $stmt = … | |
Re: [QUOTE=1987;1088022]... when I try to open those php files as a web application, that appears as a html web application.[/QUOTE] What do you mean? Are you seeing the PHP code in your browser? If that is so, you might want to check if your PHP uses the short_tags syntax [icode]<? … | |
Re: Hey. The [url=http://dev.mysql.com/doc/refman/5.1/en/lock-tables.html]LOCK TABLES and UNLOCK TABLES[/url] commands are used to block other "sessions" [I](other scripts, basically)[/I] from reading and/or modifying tables while your session is using them. This is handy for scripts that need to get an accurate overview of entire tables/databases without them being modified while the script … | |
Re: Hey. It this case there isn't really much of a security risk. Only risk of a user messing up his own navigation links, really. However, rules #1, #2 and #3 in web-development are to ALWAYS validate ALL user input, so I would suggest that you do so. - Just because … | |
Re: Hey. I think you may be mixing up the [url=http://php.net/dom_document]DOMDocument[/url] and [url=http://php.net/simple_xml]SimpleXML[/url] syntax in your PHP code. The [icode]$xml->element[0]->attribute[/icode] syntax is from the SimpleXML class, and won't work with DOMDocument objects. Try something more like: [code=php] <?php $doc = new DOMDocument; $doc->load('../order1.xml'); $laptops = $doc->getElementsByTagName('laptop'); foreach($laptops as $laptop) { $name … | |
Re: Hey. I would recommend, rather than pile all the input boxes you want validated into the form's [icode]onsubmit[/icode]event attribute, have the callback function pull them out for you. Like: [code=javascript] <!DOCTYPE html> <html> <head> <title>Test</title> <script type="text/javascript"> function validateFormOnSubmit(form){ var textBox = form.textBox1; var passwordBox = form.txtPassword; if(textBox.value == '') … | |
Re: Hey. Can you explain this a little better? Just so we know what we are looking for. The phrase "is not working" (in any form) is a completely useless statement when you are describing your problem. We already know it's not working. That is why you posted it. What we … | |
Re: Hey. Try something like this: [code=javascript] $(document).ready(function() { $('#form1').bind ('submit', form1_submit); function form1_submit() { var name = $('#username').val(); var password = $('#password').val(); $.ajax ({ type: "POST", url: "test.php", data: {data: name + "/" + password}, success: form1_submit_callback }); return false; } function form1_submit_callback(data) { if(data == "F") { alert("Password is … | |
Re: Of course. If you leave it at [I]none[/I], nobody can alter any [I].htaccess[/I] settings, which is always more secure than allowing anybody to alter any of them. But in general the [I].htaccess[/I] files are fairly secure, even when the [I]AllowOverride [/I]is set to all. You just need to make sure … | |
Re: I wouldn't disregard it complete, though, out of fear of backwards incompatibility. Not before testing it. If you are worried about compatibility with older code, setting up a test server on a development machine, or just on your own PC using VirtualBox [I](or something equivalent)[/I], isn't hard to do. If … | |
Re: Netbeans or Aptana. Both can be used on either Windows or Linux, and include both of those features. | |
Re: I would suggest Netbeans or Aptana for the PHP/HTML/CSS/JavaScript stuff. Both are free. I use Netbeans myself. Can't help you with the Flash stuff. Don't really like Flash/Silverlight based webs. [I](3'rd party, proprietary, plugins. Not a good idea to rely on that.)[/I] I would use Silverlight, tho, if I was … | |
Re: Hey. I don't see a problem in the rules. Even tried it and it worked fine on my test server. [code=text] <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^([a-zA-Z0-9_-]+)/?$ profile.php?username=$1 </IfModule> [/code] [I]Note that I combined the two rules into a single rule. The [icode]/?[/icode] at the end there means: … ![]() | |
Re: [QUOTE=nschessnerd;1070504]php 3.5.1[/QUOTE] Please tell me this is a typo?! xD As to your problem... It jumps to ~20% on every PHP execution when you have cUrl enabled, even scripts that don't use it? Sounds like a problem with the Curl extension to me. Have you tried disabling the extension and … | |
Re: Hey. I can't really see any reason why that wouldn't work. The [icode]mail()[/icode]function is always a bit hard to work with tho. Try something like [url=http://phpmailer.worxware.com/]PHPMailer[/url] and see if you that works any better. You can set the SMTP info directly in the code and get it to output the … | |
Re: Hey. [QUOTE]1 - i want to know how to prevent anyone to hack my site? i made on every textfield or textarea on posting or getting it the htmlspecialcharacter($_POST['name']) is this true? and can it help me?[/QUOTE] The [url=http://php.net/htmlspecialchar]htmlspecialchar[/url] function is meant to be used when printing unsafe data to … |
The End.