Bạn đang xem: Echo alert php

This question is not reproducible or was caused by typos. It is not currently accepting answers.

Want lớn improve sầu this question? Update the question so it's on-topic for Stachồng Overflow.

Closed 5 years ago .

I want khổng lồ display an alert box showing a message with PHP.

Here is my PHP code:

"; emang đến "alert(message successfully sent)"; //not showing an alert box. echo ""; exit; ?>

But it is not working.

Xem thêm: how to disable tag a in javascript

Why do you want header("Location:form.php") at the top? If you want to redirect the user to khung.php AFTER the alert, you should just redirect the user in the Javascript as such : echo 'location.href="form.php"'; – ashiina Dec 12 "12 at 10:39
Look what you have sầu written => echo 'alery(message successfully sent)'; //not showing an alert box. It should be alery not akery. – Pratik Mar 10 "14 at 5:01

use this code

emang đến "";

The problem was:

you missed " It should be alert not alery
changed it but still not working. – prakash_d22 Dec 12 "12 at 10:17
prakash_d22 have sầu you tried to debug it in firebug because the code is correct. – Yogesh Suthar Dec 12 "12 at 10:19
Yes I know the code is fine, but I am not getting the alert box.Is it because of header/exit clause? – prakash_d22 Dec 12 "12 at 10:21
prakash_d22 may be it was causing problem. Try to lớn bình luận it and try. – Yogesh Suthar Dec 12 "12 at 10:23
How can I print the value of variable in the message? – zar Sep 18 "15 at 18:29

Try this:

Define a funciton:

gọi it lượt thích this:

& also this eđến '";

When I just run this as a page

"; emang đến "alert("message successfully sent")"; emang đến ""; exit;

it works fine.

What version of PHP are you running?

Could you try echoing something else after: $testObject->split_for_sms($Chat);

Maybe it doesn"t get to that part of the code? You could also try these with the other function calls to kiểm tra where your program stops/is getting to lớn.

Hope you get a bit further with this.

this code worked for me eđến (""); – prakash_d22 Dec 12 "12 at 10:40
So you're echoing the whole string as a whole. Does your whole page + function calls run okay now? – CE_REAL Dec 12 "12 at 10:42
yes thanks everyone for help.. – prakash_d22 Dec 13 "12 at 12:14

I don"t know about php but i belive the problem is from this :

emang lại "";
Highly active sầu question. Earn 10 reputation in order lớn answer this question. The reputation requirement helps protect this question from spam và non-answer activity.

Not the answer you're looking for? Browse other questions tagged php javascript html alert or ask your own question.

Why does my JavaScript code receive a “No 'Access-Control-Allow-Origin' header is present on the requested resource” error, while Postman does not?
Video Game where you control a woman (an acrobat?) in early 1900s Europe who can interact with shadows
When the main character talks to the camera, is that 3rd person or another technical term for point of view?
Thesis writing - should I write "will be discussed later" or "as was discussed previously"
Which countries (or comparable geographical units) have a lower population now than they used lớn at some point in history before 1950?
Cannot find a journal paper on a study on caffeine, even though it is registered at
Why isn't there a high spike visible in the CMBR, due to a massive recombining of electrons và protons
Why is the zh (ʒ) sound so infrequent in English? more hot questions
Stack Overflow Questions Jobs Developer Jobs Directory Salary Calculator Help thiết bị di động
Products Teams Talent Advertising Enterprise
Company About Press Work Here Legal Privacy Policy Terms of Service Liên hệ Us Cookie Policy
Staông chồng Exchange Network Technology Life / Arts Culture / Recreation Science Other
Stachồng Overflow Server Fault Super User Web Applications Ask Ubuntu Webmasters trò chơi Development
TeX - LaTeX Software Engineering Unix & Linux Ask Different (Apple) WordPress Development Geographic Information Systems Electrical Engineering
Android Enthusiasts Information Security Database Administrators Drupal Answers SharePoint User Experience Mathematica
Salesforce ExpressionEngine® Answers Staông chồng Overflow em Português Blender Network Engineering Cryptography Code Reviews
Magenlớn Software Recommendations Signal Processing Emacs Raspberry Pi Staông xã Overflow на русском Code Golf
Stack Overflow en español Ethereum Data Science Arduino Bitcoin Software Quality Assurance & Testing Sound Design
Windows Phone more (28)
Photography Science Fiction & Fantasy Graphic Design Movies & TV Music: Practice & Theory Worldbuilding Video Production
Seasoned Advice (cooking) trang chủ Improvement Personal Finance & Money Academia Law Physical Fitness Gardening & Landscaping
Parenting more (10)
English Language & Usage Skeptics Mi Yodeya (Judaism) Travel Christianity English Language Learners Japanese Language
Chinese Language French Language German Language Biblical Hermeneutics History Spanish Language Islam
Русский язык Russian Language Arqade (gaming) Bicycles Role-playing Games Anime & Manga Puzzling
Motor Vehicle Maintenance & Repair Board & Card Games Bricks Homebrewing Martial Arts The Great Outdoors Poker
Chess Sports more (16)
MathOverflow Mathematics Cross Validated (stats) Theoretical Computer Science Physics Chemistry Biology
Computer Science Philosophy Linguistics Psychology & Neuroscience Computational Science more (10)
Blog Facebook Twitter LinkedIn Instagram

site design / logo © 2021 Stachồng Exchange Inc; user contributions licensed under cc by-sa. rev 2021.3.29.38936