Notice Use Of Undefined Constant Php Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the use of undefined constant php - assumed 'php' company Business Learn more about hiring developers or posting ads with us Stack Overflow php define global constant Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 use of undefined constant php assumed php codeigniter million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Use of undefined constant error in php up vote -3 down vote favorite The following code
Use Of Undefined Constant Laravel
$email_user = "Roshan"; $email_pass = "admin"; $email_quota = "200"; $call = array(domain=>$email_domain, email=>$email_user, password=>$email_pass, quota=>$email_quota); echo json_encode($call); ?> generated following error: Notice: Use of undefined constant domain - assumed 'domain' in C:\xampp\htdocs\test2.php on line 7 Notice: Use of undefined constant email - assumed 'email' in C:\xampp\htdocs\test2.php on line 7 Notice: Use of undefined constant password - assumed 'password' in C:\xampp\htdocs\test2.php on line 7 Notice: Use of undefined constant quota - assumed 'quota' in use of undefined constant php define C:\xampp\htdocs\test2.php on line 7 {"domain":"abc@gmail.com","email":"Roshan","password":"admin","quota":"200"} I want to know the occurrence of this and in this case what can be done to prevent this error. php warnings share|improve this question edited Mar 20 at 20:07 Roman C 34.4k133559 asked Dec 22 '14 at 6:56 rdkrosan 516 2 You have to put the key in quotes! –Rizier123 Dec 22 '14 at 6:58 add a comment| 3 Answers 3 active oldest votes up vote 2 down vote accepted array(name => value) is not a valid syntax, php doesn't now what name is. You need quotation marks around your array keys. Use array("domain" => $email_domain, ... etc. share|improve this answer answered Dec 22 '14 at 6:58 meagar♦ 136k21203238 add a comment| up vote 1 down vote You should use quotes around the keys in the array, like this :- $call = array('domain'=>$email_domain, 'email'=>$email_user, 'password'=>$email_pass, 'quota'=>$email_quota); share|improve this answer answered Dec 22 '14 at 6:58 Khushboo 1,4161313 add a comment| up vote 1 down vote If you want to use literals as your array keys, you need to surround them in either double or single quotes: $call = array('domain'=>$email_domain, 'email'=>$email_user, 'password'=>$email_pass, 'quota'=>$email_quota); share|improve this answer answered Dec 22 '14 at 6:59 Mureinik 103k2054103 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us use of undefined constant - assumed laravel Learn more about Stack Overflow the company Business Learn more about hiring developers or
Define Constant Php
posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow
Php Class Constants
Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How do I resolve the error “PHP Notice: Use http://stackoverflow.com/questions/27597900/use-of-undefined-constant-error-in-php of undefined constant”? [duplicate] up vote 1 down vote favorite Possible Duplicate: Notice: Use of undefined constant Quantity - assumed 'Quantity' I have a strange error message after using the post to wall function. It did successfully post to the wall however i got a very weird strange error. [30-Jan-2012 23:36:49] PHP Notice: Use of undefined constant message - assumed 'message' in C:\www\jetstar\starpick\rewards.php on line 33 [30-Jan-2012 http://stackoverflow.com/questions/9066489/how-do-i-resolve-the-error-php-notice-use-of-undefined-constant 23:36:49] PHP Notice: Use of undefined constant picture - assumed 'picture' in C:\www\jetstar\starpick\rewards.php on line 34 [30-Jan-2012 23:36:49] PHP Notice: Use of undefined constant link - assumed 'link' in C:\www\jetstar\starpick\rewards.php on line 35 [30-Jan-2012 23:36:49] PHP Notice: Use of undefined constant name - assumed 'name' in C:\www\jetstar\starpick\rewards.php on line 36 [30-Jan-2012 23:36:49] PHP Notice: Use of undefined constant caption - assumed 'caption' in C:\www\jetstar\starpick\rewards.php on line 37 This is the codes i use $facebook->api("/me/feed", "post", array( message => "I have won a ".$prizename, picture => "http://i1172.photobucket.com/albums/r574/092810c/starpicklogo-1.png", link => "https://apps.facebook.com/starpick/", name => "StarPick", caption => "Stand to Win Attractive Prizes!!!")); php facebook facebook-wall share|improve this question edited Feb 4 '12 at 12:18 Mat 136k21235274 asked Jan 30 '12 at 15:42 user1175105 15125 marked as duplicate by hakre, Robert Harvey♦ Jan 30 '12 at 15:47 This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. The answer is short: By understanding the error message. Which actually contains the solution if you read it carefully. –hakre Jan 30 '12 at 15:47 i think you should use $message,$picture etc or variable as u define. –Divyesh Jesa
Tips/Tricks Top Articles Beginner Articles Technical Blogs Posting/Update Guidelines Article Help Forum Article Competition Submit an article or tip Post your Blog quick answersQ&A Ask a Question View Unanswered Questions View All Questions... Linux questions C# questions ASP.NET questions SQL questions fabric http://www.codeproject.com/Questions/619252/Notice-Use-of-undefined-constant-Y-assumed-Y-in-xa questions discussionsforums All Message Boards... Application Lifecycle> Running a Business Sales / Marketing Collaboration / Beta Testing Work Issues Design and Architecture ASP.NET JavaScript C / C++ / MFC> ATL / WTL / STL Managed C++/CLI C# Free Tools Objective-C and Swift Database Hardware & Devices> System Admin Hosting and Servers Java .NET Framework Android iOS Mobile SharePoint Silverlight / WPF Visual Basic Web Development Site Bugs / Suggestions Spam and Abuse Watch features Competitions News use of The Insider Newsletter The Daily Build Newsletter Newsletter archive Surveys Product Showcase Research Library CodeProject Stuff communitylounge Who's Who Most Valuable Professionals The Lounge The Insider News The Weird & The Wonderful The Soapbox Press Releases Non-English Language > General Indian Topics General Chinese Topics help What is 'CodeProject'? General FAQ Ask a Question Bugs and Suggestions Article Help Forum Site Map Advertise with us About our Advertising Employment Opportunities About Us Ask a Question use of undefined All Questions All Unanswered FAQ why PHP Notice: Use of undefined constant Y - assumed 'Y' in xampp 1.8.2 for define (Y,120) Rate this: Please Sign up or sign in to vote. See more: PHP Apache xampp hi file test.php is : ?php define(Y,120); ?> after upgrade xampp version to 1.8.2 , When executing script there is given notice: Notice: Use of undefined constant Y - assumed 'Y' Posted 10-Jul-13 19:29pm Mahnoosh_M1.2K Updated 10-Jul-13 19:54pm v4 Add a Solution Comments timmit18 11-Jul-13 1:36am show your code. Mahnoosh_M 11-Jul-13 1:57am it is just one line define(Y,120); timmit18 11-Jul-13 2:03am have you tried wrapping Y with single quote? Mahnoosh_M 11-Jul-13 2:07am Thanks, solved timmit18 11-Jul-13 2:11am your welcome. accept my answer.please :) Mahnoosh_M 11-Jul-13 3:09am you sent your solution in comments .. I cant accept it . Please add your solution . then I will accept it . thank you 1 solution Rate this: Please Sign up or sign in to vote. Solution 1 Accept Solution Reject Solution have you tried wrapping Y with single quote? :) Permalink Posted 10-Jul-13 21:13pm zenspace1.1K Add a Solution Add your solution here B I U S small BIG code Plain TextC++CSSC#Delphi / PascalF#HTML / XML / ASPJavaJavascriptObjective-CSQLPerlPHPPythonVBXMLvar < > & link [^] encode untab case indent outdent OK