English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am using php, mysql and ajax. when a user registers the data is saved dynamically using ajax. There seem to be a problem. Suppose you type password with special characters example abc123&234

only "abc123" is received by php on the server. How do i escape this string in javascript and unescape it in php.
Thankyou.

2006-09-09 14:56:59 · 5 answers · asked by Manish 5 in Computers & Internet Programming & Design

5 answers

In javascript, use escape( "the string" )

In php, use html_entity_decode() to convert them back.

What is happening is the ampersand is a parameter delimiter, so the ampersand and anything after it is ignored (but you probably already knew that).

2006-09-09 15:42:15 · answer #1 · answered by sheeple_rancher 5 · 1 1

To convert a string to the URL-encoded form suitable for transmission as a query string (or, generally speaking, as part of a URL), use the escape function. This function works as follows: digits, Latin letters and the characters + - * / . _ @ remain unchanged; all other characters in the original string are replaced by escape-sequences %XX, where XX is the ASCII code of the original character. Example:

escape("It's me!") // result: It%27s%20me%21

In Unicode-aware browsers (that support JavaScript 1.3) the function escape has a more complex behavior. If the input is a Unicode string, then Unicode characters will be converted to the Unicode escape-sequences %uXXXX.

2006-09-09 16:24:41 · answer #2 · answered by agbrisco 4 · 0 1

The issue is that the problematic characters are being scrubbed before they get processed by php.

If you turn this feature off, you are asking for trouble, because you are allowing people to insert things like scripts into what they type on your page. Or they can try a buffer overflow attack.

If you turn this feature off, you are going to need to write some code that scrubs the user text for you.

Easiest thing is to perform client-side authentication and warn the users before they make a password with characters like < > &.

2006-09-09 15:14:46 · answer #3 · answered by Tom D 4 · 1 1

ampersand is a special character, it could confuse a simple program.

1) upgrade your php.
2) use method="post" instead of "get" on the form.

2006-09-09 20:46:33 · answer #4 · answered by jake cigar™ is retired 7 · 0 0

clean the junk out time:
speed up the pc free up hard drive space
speed up your internet
its clean out junk time
have your system & internet running at top speed

System Mechanic 6 ... if you have a firewall/ anti virus ... get this version

System Mechanic professional 6 ... if you want firewall/anti virus get this version

when on the website click on Try it free for 30 days

you can only run 1 anti virus/firewall
on your system

DO NOT USE : DriveScrubber® 2 :ONLY IF YOU WANT TO HAVE ALL DATA REMOVED OFF THE PC
DriveScrubber® 2
Securely wipe all data on your drives.// only use this if you want too
remove all data from all hard drives //flash drives



System Mechanic 6 &
System Mechanic professional 6


has won these
coveted awards and received these rave reviews:

Contains all the great tools from System Mechanic Personal (See below). 6 Award winning products in one! The Ultimate Arsenal of Tools to Safely Speed-up, Fix, Optimize and Maintain Your PC 24 Hours a Day!

Features

system information check
click on maintain ..tab
click on system information report
cpu /memory check
to check your system
click on maintain ..tab
click on system information report
full list of system information
processor
memory
motherboard
bus
video
monitor
storage
audo
network adapeter
ports



System Mechanic® 6
Find and fix problems
Antivirus Protection
Protection from viruses, trojans, worms, and more
Internet Firewall
Protection against Internet threats
Search and Recover™ 3
Recover deleted data
DriveScrubber® 2
Securely wipe all data on your drives.

The only tool you'll need to keep your PC running fast, smooth, and error-free. New PC TotalCare™ combines all of the System Mechanic power into a single one-button interface for the perfect blend of absolute power and effortless simplicity.
Computer become cluttered, disorganized, and sluggish if not regularly cleaned. Automatically remove
system junk using the new PC Cleanup Wizard, keeping Windows fresh and fast
Using the new PC Acceleration Wizard, you can automatically optimize system settings and eliminate velocity bottlenecks for maximum gains in overall performance.

Automatically find and repair Windows security flaws that leave you open to attack from computer enemies such as spyware, adware, viruses, hackers, and identity thieves.
Use the new PC Repair Wizard to automatically diagnose and fix hundreds of problems with hard drives, system components, installed software, hardware, and more.

The System Mechanic antivirus technology repeatedly places first in independent tests. Work and play without fear of infection form viruses, worms, trojans, and other nasty enemies that can wreak
unnecessary havoc.

The System Mechanic Spython™ tool effectively eliminates spyware infection and uses proprietary methods to stop parasites before they start.

System Shield protects your PC from unwanted attempts at uncovering private or confidential data. Shield yourself against identity theft or personal misrepresentation.


Formatting your hard drive does not remove or erase your data. Many programs can recover data from a formatted drive. With DriveScrubber®, you can securely overwrite and remove all data to ensure 100% security.

Get back deleted pictures, videos, MP3s, e-mail, documents, spreadsheets, system files, and any other file or folder on your hard drive, CD/DVD media, MP3 player, digital camera, memory card, or other portable device using the new powerful Search and Recover StrongScan™ technology.


Key Features and Benefits

Eliminate Spyware
Protect Against Viruses
Defend Against Internet Threats and Hackers
Recover Deleted Data
Rescue Data from System Crashes
Protect Against Identity Theft
Wipe Data from Drives
Defrag Hard Drives
Solve stubborn PC problems
Award-winning virus protection
Advanced spyware protection
Accelerate performance up to 300%

Enabling Homepage Guard will keep your Internet home page from changing without your knowledge. It stops malware, adware, viruses and other Web sites from taking you anywhere you do not want to go.

Enabling Search Page Guard keeps your Internet search page from changing without your knowledge. It stops malware, adware, viruses and other Web sites from taking you anywhere you do not want to go.



Fix System Errors
Speed up Internet Access
Recover from Disaster
Clean up System Clutter
Defrag Memory
Optimize the Registry
Block Web Popups
Set up Scheduled Maintenance
Repair Windows Security Flaws
Repair drives after system failure
Rescue data from system crashes
One-click complete PC tune-up
Complete system cleanup



Stop Dangerous Programs from Starting
Make Windows Boot Faster
Uninstall or Relocate any Program
Tweak Hundreds of System Settings
Save and Compare System Snapshots
...and so much more!

IMPROVED! Spyware Protection

Advanced protection from spyware, malware, adware, and other PC parasites.

NEW! Disaster Recovery

Rescue PCs that won't start and revive damaged hard drives.

NEW! Startup Optimizer

Accelerate boot speeds by optimizing the programs that start with Windows.

FASTER! Disk Defrag

Defragment drives up to ten times faster than the Windows built-in defragmenter.

NEW! Fix Hard Drive Problems

Drive Medic™ fixes disk problems before they can cause data loss or system failure.

NEW! Comprehensive System Inspector Tool

Get ultra-detailed diagnostic reports of all hardware and software in your PC.

ENHANCED! Registry Optimization

Find and fix even more problems that can arise from the Registry and cripple your system.

NEW! Advanced Process Manager

Look under the hood and see what's running. Optionally block dangerous items from starting again.

Eliminate spyware

Defrag hard drives

Fix system errors

Speed up Internet access

Recover from disaster

Clean up system clutter

Defrag memory

Optimize the Registry

Block Web popups

Set up scheduled maintenance

Repair Windows security flaws

Stop dangerous programs from starting

Make Windows boot faster

Uninstall or relocate any program

Tweak hundreds of Windows settings

Save and compare system snapshots



http://www.iolo.com/sm/

2006-09-09 15:00:04 · answer #5 · answered by Anonymous · 0 6

fedest.com, questions and answers