premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
I do not see why it would be loading slow when an error is encountered, as you are not doing any loops and the regex is minimal. As far as JS speeding it up, it may, but as I stated before using JS you risk someone turning off JS and bypassing all of your validation, which means invalid data can easily get through.
-
The reason, Firefox has a built in Spell Checker. IE does not. If you turn off your Firefox spell checker, I bet pspell does not work well at all in FF.
-
You can use the domxpath or the simple_xml functions to parse XML data effectively. I would suggest looking into those.
-
The only reason it would be slow is possibly from the mail server, which it would be if you are using SMTP to connect to it. JS will not solve the "slow" problem and the main issue with validating in Javascript is that Javascript can be turned off and thus the user has circumvented your validation all together. The code itself looks fine, given that I highly doubt that incorporating javascript validation will speed it up.
-
http://www.phpclasses.org/browse/package/1298.html There is one an old staff member created.
-
takefile('aim','test','..images/buttons/','N'); From what you posted is not inside of <?php ?> or <? ?> so it will just display as text, unless you did not post the exact code.
-
You still fail to point out what exactly is different. First you said it was just the header, ok, I found part of the header that was different, now it is more items on the site (Which I did take notice to). You cannot expect someone to just waltz right in and find everything that is different on your site and fix it for you. Point out the specific parts that are different, paste the relevant code to those sections. As far as this being a PHP issue, well what is different between the two sites? Why not just re-copy the database / .php code straight from the good site to the bad site, as that should correct it. As the only way they could be displaying different is due to differences in code / database data. I still fail to see why you would not just do a new straight copy of the database and website from siteA to siteB, as that seems the most logical choice to do and it should fix the errors.
-
Yep, I dynamically generate all my pages using PHP and MySQL en-coupled with a bit of mod_rewrite to get them to appear to be real .html pages. This is done quite frequently, allows for dynamic content to appear to be "static" pages and it makes it way easier to manage. For examples, you can look at Wordpress, as they use the same techniques.
-
Search engine crawlers and protected pages
premiso replied to marcin_koss's topic in PHP Coding Help
It is, as most bots will not care to set cookies and without a cookie they cannot gain access, that and they probably do not wish to confirm their age. You can check the useragent and if the useragent is a known bot (you can find bot agent strings online) allow them access without verification. -
Not a php topic, moving to Javascript. The gist is they are using javascripts "onClick" event to make it clickable.
-
Just because PHP was used to display the page does not make it a PHP issues. As such I am moving to HTML. For the difference, you failed to state what part of the header was different. As such I will venture a guess you are referring to the Date. <td width="100%" height="25" class="normal_text04" >Today's Date: Wednesday 17th of February 2010 03:26 PM</td> That is the code that is on the systemnew site. Change it to: <td width="100%" height="25" class="normal_text04" align="right" >Today's Date: Wednesday 17th of February 2010 03:26 PM</td> And it will be like the runehints, as that is how it is in the runehints site. EDIT: The basic gist, the two pages are not exactly the same, there is a difference in the two or else they would display the same. Either a template is off or you did not copy some custom code that was written to one of the sites.
-
@fresch, the issue may not be PHP at all. It is most likely on the flash end side. I would do a search about flash removing colon's from posts and see what you come up with. In that code I do not see how it would be removing the colon. The true way to test is echo out $_POST['comments'] before you do anything to it, as this will tell you if the data is coming in without the : or if the colon was removed prior to being posted.
-
$string = preg_replace('~</ul>$~s', "<li></li>\n</ul>", $string); Should do the trick for you.
-
If you "dynamically" generate it, why not add it where you generate it?
-
You may want to read the tutorials located: http://www.phpfreaks.com/tutorial/php-security About PHP Security, if you are interested in it. No need for people to beat the topic to death as it has been covered (in that tutorial) and on this site many many many many many times.
-
PHP Regular expression to identify a link from html
premiso replied to deane034's topic in Regex Help
May not be the best way, but will match it as long as there is only 1 mp3 link per line. preg_match('~href=[\'|"](.*\.mp3)[\'|"]~i', $mystring, $match); -
Well what changed to break the script? Did you add some code? Did you change hosts? Did your host upgrade? However, my suspicion is it could be in your query on this line: $qC = mysql_query("SELECT * FROM gallery_postcards WHERE postid = '".$_GET['rid']."' AND date = '".$_GET['hash']."'"); As "Date" is a reserved word in mysql, either encapsulate in backticks (`) or change the name. I also fail to see where you actually try send the postcard to someone.
-
You can try to properly define setcookie by adding the optional params, such as host and path and see if that sets the cookie for you.
-
I would wait another day, if it is still not working, contact your host again. Sometimes it takes 24-48 hours from the time the request has been sent (if a new request has been sent this timeframe is reset) for a DNS to propagate through properly.
-
Read the tutorial. But as I said, strip_tags will prevent XSS exploits, if the text box is not suppose to contain HTML / JavaScript. XSS exploits is basically someone writing javascript code that gets run on the page which can inject cookies / redirect users to certain pages etc. Those 2 functions prevent 2 seperate items. If you are allowing HTML (not to be executed) in a textbox, you will want to look into htmlentities. Since this has been hit so many times, and I have given you the terms to search for, I will not go into greater detail on how to "secure" your script. Look at the tutorial I posted and google "prevent xss php" for more information. You can read and do research as well as I can, and since you are the one who wants to learn this, I will let you do the research.
-
You cannot ban them from injecting harmful code, but you can stop the code from running. For example, if the text box is to be for a user's name, chances are they will not need to enter any html tags, so a simple strip_tags will prevent an XSS exploit and if it is going into the database, filtering the data or at least mysql_real_escape_stringing the data will prevent SQL Injection. For a more thorough description see this PHP Security Tutorial.
-
Contact your host, as sometimes you have to notify them of the change manually and have them add it to their DNS records.
-
php coding software witch one?
premiso replied to supergrame's topic in Editor Help (PhpStorm, VS Code, etc)
This has been hammered many times and there is even a sticky located at: http://www.phpfreaks.com/forums/index.php/topic,277416.0.html As such, hamza and merylvinglen, please do not revive dead / old topics. Create a new topic if you wish to discuss Dreamweaver's capabilities. Thanks. -
help displaying partial results with "more" link
premiso replied to DarkJamie's topic in PHP Coding Help
substr would be the function I would start to look at. (I would also look at the user comments on that page) -
You need to post the actual code, as we cannot see the code from the .php file. Post it inside of tags.