Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 25th Mar 2015, 01:58 AM   #1
Active Warrior
 
Join Date: 2009
Posts: 67
Thanks: 24
Thanked 7 Times in 7 Posts
Default
How to add H1 html tag to a php code error
Share on: 
fb share twitter share gplus share more share

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.
ferenan is offline  
Unread 25th Mar 2015, 03:30 AM   #2
VIP Warrior
War Room Member
 
Join Date: 2006
Location: , , USA.
Posts: 1,795
Thanks: 70
Thanked 287 Times in 259 Posts
Default
Re: How to add H1 html tag to a php code error
Share on: 
fb share twitter share gplus share more share

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.
KirkMcD is offline  
Unread 25th Mar 2015, 04:31 AM   #3
Active Warrior
 
Join Date: 2009
Posts: 67
Thanks: 24
Thanked 7 Times in 7 Posts
Default
Re: How to add H1 html tag to a php code error
Share on: 
fb share twitter share gplus share more share

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.
ferenan is offline  
Unread 25th Mar 2015, 10:05 AM   #4
HyperActive Warrior
 
Zenoth's Avatar
 
Join Date: 2014
Posts: 185
Thanks: 32
Thanked 39 Times in 34 Posts
Default
Re: How to add H1 html tag to a php code error
Share on: 
fb share twitter share gplus share more share

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>';

Zenoth is offline  
The Following 2 Users Say Thank You to Zenoth For This Useful Post:
Unread 25th Mar 2015, 10:44 AM   #5
VIP Warrior
War Room Member
 
Join Date: 2006
Location: , , USA.
Posts: 1,795
Thanks: 70
Thanked 287 Times in 259 Posts
Default
Re: How to add H1 html tag to a php code error
Share on: 
fb share twitter share gplus share more share

Somewhere in the entire script, the value is sent to the browser.
Find that code.
KirkMcD is offline  
The Following User Says Thank You to KirkMcD For This Useful Post:
Unread 25th Mar 2015, 10:59 AM   #6
Warrior Member
 
Join Date: 2015
Posts: 1
Thanks: 0
Thanked 2 Times in 1 Post
Default
Re: How to add H1 html tag to a php code error
Share on: 
fb share twitter share gplus share more share

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>';
asoka is offline  
The Following 2 Users Say Thank You to asoka For This Useful Post:
Unread 26th Mar 2015, 05:17 AM   #7
Active Warrior
 
Join Date: 2009
Posts: 67
Thanks: 24
Thanked 7 Times in 7 Posts
Default
Re: How to add H1 html tag to a php code error
Share on: 
fb share twitter share gplus share more share

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.
ferenan is offline  
Unread 4th Apr 2015, 01:43 PM   #8
Warrior Member
 
Join Date: 2015
Location: USA
Posts: 10
Thanks: 19
Thanked 0 Times in 0 Posts
Default
Re: How to add H1 html tag to a php code error
Share on: 
fb share twitter share gplus share more share

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>

Curtnielson is offline  
Unread 10th Apr 2015, 03:48 PM   #9
Warrior Member
War Room Member
 
Join Date: 2013
Posts: 13
Thanks: 1
Thanked 2 Times in 2 Posts
Default
Re: How to add H1 html tag to a php code error
Share on: 
fb share twitter share gplus share more share

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>

bsuperc is offline  
Closed Thread


Bookmarks

Tags
add, code, error, html, php, tag


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 10:35 AM.