| | #1 |
| Active Warrior Join Date: 2009
Posts: 67
Thanks: 24
Thanked 7 Times in 7 Posts
|
Hi , I am not a coder but trying to show the below text as H1 tag but do not know how to get it done...any one can help ? $GLOBALS["msg"]="Your page has updated"; the above text "your page has updated". where to start and close the tag? Thans for any feeback. |
| |
| | #2 |
| VIP Warrior War Room Member Join Date: 2006 Location: , , USA.
Posts: 1,795
Thanks: 70
Thanked 287 Times in 259 Posts
|
Since this seems to be a custom script, you need to see how it gets displayed in order to figure out how to modify it to display the way you want.
|
| |
| | #3 |
| Active Warrior Join Date: 2009
Posts: 67
Thanks: 24
Thanked 7 Times in 7 Posts
|
Thanks for the comment MCD, It gets display as a normal small text and I just want to show it bigger or bold with H1. I hope I understood what you mean . I cant see any related html tag in the file itself and no clue from where its calling. I tried to show it like: $GLOBALS["msg"]="<h1>Your page has updated</h1>"; but no success with it. |
| |
| | #4 |
| HyperActive Warrior Join Date: 2014
Posts: 185
Thanks: 32
Thanked 39 Times in 34 Posts
|
Use <h1> tags when you display the message. Of course, escape the result before and do any additional checks ... $GLOBALS["msg"]="Your page has updated"; echo '<h1>' . $GLOBALS["msg"] . '</h1>'; |
|
Ever wanted to start a blog? Here's a step-by-step guide on how to start a blog from scratch.
| |
| |
| The Following 2 Users Say Thank You to Zenoth For This Useful Post: |
| | #5 |
| VIP Warrior War Room Member Join Date: 2006 Location: , , USA.
Posts: 1,795
Thanks: 70
Thanked 287 Times in 259 Posts
|
Somewhere in the entire script, the value is sent to the browser. Find that code. |
| |
| The Following User Says Thank You to KirkMcD For This Useful Post: |
| | #6 |
| Warrior Member Join Date: 2015
Posts: 1
Thanks: 0
Thanked 2 Times in 1 Post
|
Zenoth is right.. $ variables are PHP variables, so you can use following to add any HTML code Use following code as he suggested: $GLOBALS["msg"]="Your page has updated"; then write anywhere on the php page to write in html heading. echo '<h1>' . $GLOBALS["msg"] . '</h1>'; |
| |
| The Following 2 Users Say Thank You to asoka For This Useful Post: |
| | #7 |
| Active Warrior Join Date: 2009
Posts: 67
Thanks: 24
Thanked 7 Times in 7 Posts
|
Thanks for all ...I could be able to solve the issue. when user save data element from a website and save it to database ,how can I show the saved the data in the field ? in the example below I want to show the save title in the field box: <input name="article_title2" type="text" class="login_input" id="title2" style="width:250px;" value="<?php echo $article_title[1];?>" /> Thanks for any help. |
| |
| | #8 |
| Warrior Member Join Date: 2015 Location: USA
Posts: 10
Thanks: 19
Thanked 0 Times in 0 Posts
|
There are two main methods. I'll demonstrate both. 1: The first method is putting the php between html. This is demonstrated below. <html> <head> <title>h1 tags</title> </head> <body> <h1><?php echo $hackname = $result['hackname']; ?></h1> <p>My little description goes here</p> </body> </html> 2: The second method is to put the html in the php like so... <html> <head> <title>h1 tags</title> </head> <body> <?php echo '<h1>' . $hackname = $result['hackname'] . '</h1>'; ?> <p>My little description goes here</p> </body> </html> By the way, you can't scrap the whole '$hackname = ' part and just echo $result['hackname']. Defining a variable in an echo statement will work, but doesn't make much sense, especially in your case. Here's the above method without the '$hackname = '. <html> <head> <title>h1 tags</title> </head> <body> <?php echo '<h1>' . $result['hackname'] . '</h1>'; ?> <p>My little description goes here</p> </body> </html> |
| | |
| |
| | #9 |
| Warrior Member War Room Member Join Date: 2013
Posts: 13
Thanks: 1
Thanked 2 Times in 2 Posts
|
Honestly the cleanest approach is going to be this (assumes PHP shortcode is enabled, which most web hosts have): <html> < head> < title>h1 tags</title> < /head> < body> <h1><?=$result['hackname'];?></h1> < p>My little description goes here</p> < /body> < /html> |
| | |
| |
|
| Bookmarks |
| Tags |
| add, code, error, html, php, tag |
| |