363 Posted Topics

Member Avatar for Brandon5150

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 …

Member Avatar for Brandon5150
0
956
Member Avatar for huntsman2

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 …

Member Avatar for huntsman2
0
211
Member Avatar for rori

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 …

Member Avatar for marsystsm123
0
2K
Member Avatar for Surfsup

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 …

Member Avatar for NinjaMediaD
0
2K
Member Avatar for HasNor

[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 …

Member Avatar for Atli
0
365
Member Avatar for OmniX

[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 …

Member Avatar for Stefano Mtangoo
2
2K
Member Avatar for atalkingfish

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'])) …

Member Avatar for atalkingfish
0
82
Member Avatar for navi17

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: * …

Member Avatar for afsha khan
0
642
Member Avatar for monada

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 …

Member Avatar for charlie hsia
0
3K
Member Avatar for quecoder

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 …

Member Avatar for diafol
0
132
Member Avatar for justted

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 …

Member Avatar for Green-z
0
5K
Member Avatar for shishtawitch

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 …

Member Avatar for yannyannyann
0
488
Member Avatar for eshko

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 …

Member Avatar for chocalate
0
2K
Member Avatar for suncica2222

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 …

Member Avatar for suncica2222
0
173
Member Avatar for stylemessiah

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) + …

Member Avatar for ana10192000
0
1K
Member Avatar for shridharmaster

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 …

Member Avatar for deepshikha.joha
0
824
Member Avatar for samarudge

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.

Member Avatar for Atli
0
65
Member Avatar for dipak83

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 …

Member Avatar for pzuurveen
0
233
Member Avatar for ajwei810192

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 …

Member Avatar for ajwei810192
0
140
Member Avatar for nick3592

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.

Member Avatar for JRM
0
136
Member Avatar for jhonnatas

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 …

Member Avatar for jhonnatas
0
119
Member Avatar for fortiz147

[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 …

Member Avatar for light-man
1
341
Member Avatar for littlebear330

Hi. Try removing the "ssl://" from the host URI. The PHPMailer code should add that for you in the background.

Member Avatar for rajarajan2017
0
369
Member Avatar for electrogear

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 …

Member Avatar for electrogear
0
233
Member Avatar for tryingtofindout

[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 …

Member Avatar for tryingtofindout
0
101
Member Avatar for whiteyoh

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. …

Member Avatar for whiteyoh
0
61
Member Avatar for itisnot_me

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 …

Member Avatar for Atli
0
109
Member Avatar for rikinshah

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 …

Member Avatar for Atli
0
161
Member Avatar for prem2

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 …

Member Avatar for Atli
0
113
Member Avatar for balam

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]

Member Avatar for balam
0
122
Member Avatar for takeshi

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}"; …

Member Avatar for takeshi
0
93
Member Avatar for Midnite007

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 …

Member Avatar for Atli
0
249
Member Avatar for genieuk

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 …

Member Avatar for Atli
0
248
Member Avatar for emhmk1

Hey. Perhaps: [code=php] $referrer = str_replace('&action=login', '', $_SERVER['HTTP_REFERER']); [/code]

Member Avatar for emhmk1
0
238
Member Avatar for genieuk

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 = …

Member Avatar for genieuk
0
168
Member Avatar for 1987

[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]<? …

Member Avatar for 1987
0
130
Member Avatar for SKANK!!!!!

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 …

Member Avatar for SKANK!!!!!
0
174
Member Avatar for Xamas

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 …

Member Avatar for Atli
0
144
Member Avatar for 7akimz

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 …

Member Avatar for Atli
0
154
Member Avatar for rukshilag

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 == '') …

Member Avatar for Atli
0
86
Member Avatar for ruwanaru

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 …

Member Avatar for ruwanaru
0
123
Member Avatar for Chad Gary

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 …

Member Avatar for Atli
0
105
Member Avatar for sam023

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 …

Member Avatar for Atli
0
105
Member Avatar for cwarn23

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 …

Member Avatar for Atli
2
155
Member Avatar for veledrom

Netbeans or Aptana. Both can be used on either Windows or Linux, and include both of those features.

Member Avatar for Atli
0
68
Member Avatar for Stefano Mtangoo

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 …

Member Avatar for kireol
0
81
Member Avatar for DaveCachia

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: …

Member Avatar for diafol
0
198
Member Avatar for nschessnerd

[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 …

Member Avatar for nschessnerd
0
894
Member Avatar for kenwestphal

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 …

Member Avatar for pritaeas
0
225
Member Avatar for hapizi84

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 …

Member Avatar for glycerine
0
274

The End.