| | |
Basic code problem
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Mar 2008
Posts: 2
Reputation:
Solved Threads: 0
php Syntax (Toggle Plain Text)
<? function outError($text){ print "<center><b><font color = red>$text</font></b><br><br></center>"; }
php Syntax (Toggle Plain Text)
<option value="0" <?= ($installtype == "0") ? "selected" : ""; ?> >Install with CPanel Info (can create MySQL DB automatically)</option>
I have a script with such unusual tags and the script won't work. I cannot replace them since they are a thousands in number. And search and replace also didn't work.
thank you.
Hi gouthamvel and welcome to DaniWeb 
I think we may need a bit more information to help you on this one. Can you please post the code for the select tag that this option tag is a part of? What do you mean by the script won't work? Does the page load? Is it just not displaying the options in the select? Are there any error messages? Is it the function that doesn't work as you would like and if so does anything happen when you call it?

I think we may need a bit more information to help you on this one. Can you please post the code for the select tag that this option tag is a part of? What do you mean by the script won't work? Does the page load? Is it just not displaying the options in the select? Are there any error messages? Is it the function that doesn't work as you would like and if so does anything happen when you call it?
There are no stupid questions, only those too stupid to ask for help.
echo is a web developer's best friend. I think these lines
should be
Also, you should always use <?php in favour of the shorthand tags. Some servers do not support the shorthand tags, so for maximum compatibility use the longer version (it's only 3 more characters and the benefit is certainly worth it).
php Syntax (Toggle Plain Text)
<option value="0" <?php ($installtype == "0") ? "selected" : ""; ?> >Install with CPanel Info (can create MySQL DB automatically)</option>
php Syntax (Toggle Plain Text)
<option value="0" selected=<?php ($installtype == "0") ? "selected" : ""; ?> >Install with CPanel Info (can create MySQL DB automatically)</option>
There are no stupid questions, only those too stupid to ask for help.
echo is a web developer's best friend. Actually it should be as follows:
html Syntax (Toggle Plain Text)
<option value="0" <?php echo ($installtype == "0" || $installtype == 0) ? "selected" : ""; ?> >Install with CPanel Info (can create MySQL DB automatically)</option>
Try not to bump 10 year old threads as it can be really annoying.
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
![]() |
Similar Threads
- Can you help me with visual basic code? (Visual Basic 4 / 5 / 6)
- java very basic input problem (Java)
- c++ source code problem urgent!!!! (C++)
- Windows Visa Home Basic Major Problem (Windows Vista and Windows 7)
- Dead end with basic code (C)
- Need to Preload many Images (and show a wait screen) (JavaScript / DHTML / AJAX)
- Problem with basic templates on GCC (C++)
- Code Snippet: Send HTML code to Internet Explorer from basic (Legacy and Other Languages)
- DrawHouse Code Problem (Java)
Other Threads in the PHP Forum
- Previous Thread: sql syntax issue
- Next Thread: Forum Signature
| Thread Tools | Search this Thread |
advanced ajax apache api array basics beginner binary broken cakephp check checkbox class cms code combobox cookies cron curl database date datepart display dynamic echo email error file files folder form forms function functions google head href htaccess html image include includingmysecondfileinthechain insert integration ip java javascript job joomla js limit link login loop mail menu mlm multiple mysql oop parse password paypal pdf php problem procedure query radio random recursion regex remote script search server sessions smarty smash sms soap source space sql stored syntax system table traffic tutorial unicode update upload url validator variable video web xml youtube






