Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Inserting A Variable Into An Html Element


I am trying to pull information from a mysql database to display an image or create a link and have not been able to get either to work. Code:




View Complete Forum Thread with Replies

Related Forum Messages:
Inserting Adsense Code - Html Program That Automatically Coverts All My Text Files To Html Webpages?
I've purchased a text to html program that automatically coverts all my text files to html webpages within a template, but the only problem is how do I insert my adsense code into all 250 pages? I've seen articles regarding PHP includes for page templates, but I'm not sure how this would work inserting my code.

View Replies !
Getting One XML Element Into A PHP Variable
I want to get the information (in *s) from the following feed into a PHP variable: Code:

View Replies !
Add A PHP Element To An HTML Page?
I have a .htm page on which I want to add a PHP script that will display links depending on if the user is in session or not. I'm not sure if this can be done on a strictly .htm page, but hey you only live once right?  Here's the script I'm attempting to execute:

   <? if ($_SESSION['auth'] == "yes"){ ?>
       <a href="/index.php?page=sign_in">Sign In[/url]
             <? }else{ ?>
       <a href="index.php?page=logout">Logout[/url]
   <? } ?>

The problem is that I don't know all the back-end php coding for the 3rd party s/w I'm using, but since the design calls for a "main .htm page" that displays all the "include" pages, having 2 links displaying on the same page seems silly (1 link for login and anohter for logout).

View Replies !
Pull An Xml Element Into As A Variable
I've got a php page, process.php, and an xml page, data.xml. I need to access the element <xmltitle> from the data.xml file and bring it into process.php as a variable.

View Replies !
Retrieve The Copy Within An Html Element
I would like to know if it's possible to retrieve the copy within an html element using php.

Specifically i'd like to have a script that read the contents of a <p></p> tag with the id 'title' and saved it as a variable. there can be no .php within the html itself.

Is this possible or is there a better way of going about it?

View Replies !
Converting The Posted String To The Value Of Html Element
I've been very confused in dealing with posted strings. For example, if I fill in a text element with "(double quote), submit it and display it in a text and a textarea, I get "(backslash followed by double quote) in the textarea element but (backslash only) in the text element.

Code:
<input name="somename" value="<?php if(isset($HTTP_POST_VARS['submitName'])) echo $HTTP_POST_VARS['somename']; ?>" />

I made a function which correct the misbehavings:

View Replies !
Referencing An Array Element With A String Variable
I've been researching this for hours and can't seem to find the right
syntax.

I need to retrieve a value of an array by referencing the element using a
string variable.

For example:

$data['lastname'] = 'hank'
$element = 'lastname'
echo $data[$element];

View Replies !
Inserting Html Into Db
i have a table to hold large blocks of text, and naturally the text contains multiple paragraphs. so i want to store <p> tags to separate it out.

i tried both addslashes() and htmlspecialchars(), then stripslashes() upon retrieval, but the result includes the tags as text. how do i fix this? NOTE: My db is Msql NOT mysql!

View Replies !
Inserting HTML Into A Database?
I'm trying to upload HTML into my database. I'm using:

$description=addslashes($_POST['description']);

However, when i use HTML inside the content that i'm uploading, the code gets all messed up, when viewing the code inside the textarea? I'm trying to build an EDIT section, But the code i want to edit is not user friendly? Code:

View Replies !
Inserting HTML Into Mysql, Is It Possible?
i want my users to be able to insert html into my mysql database, is this possible?
and how would i go about doing it, or could you point me in a direction that would tell me?

View Replies !
Inserting Html Into Flash
I am working on a project. the client want me to make a flash movie that calls up existing html text into the flash file. is there a way of doing this without using the variables- the client would have to change the html code to include variables on 250 pages- not do-able. There must be an easier way.

View Replies !
Inserting Form Html
What I am doing is editing the paypal form link so that when the user adds a price to the database it will automatically create the paypal form as well.

The only problem I am having is that I can not get the html to insert into the database as it just says that I have an error in my SQL syntax where the first URL is as the form action. Code:

View Replies !
Inserting $ Into Html Form
I want to input a bit of php into this code.

<input type="hidden" name="item_name" value="<?php '$name'?>">

I need it for a paypal 'add to cart' button. I have tries various quotes and brackets but just can't seem to sort it.

View Replies !
Inserting Html Tags Into Php
I have a list of news items that I would like separated by a line break. Whenever I insert a <p> or a <br /> the news items all get surrounded by quotes and seperate the items by more than a line break. Here is my php:

while ($article = mysql_fetch_array($articles)) {

$id = $article['id'];
$articletext = $article['LEFT(articletext, 120)'];

// If the article text is 120 characters long, add "..." to the end of it
// to indicate that it is actually longer. strlen() returns string length!
if (strlen($articletext) == 120) {
$articletext .= "...";
}.

View Replies !
Variable And Inserting Into MySQL
I have a PHP script that pulls data from an external URL. I can fetch and print the data without using a MySQL database, but I can't figure out how to add a separate entry for each "idnumber". Here is a snip from my code that relates to what I'm referring to:

How can I insert them into the MySQL database. Here's what I've tried, but it isn't adding the info to the database.

$sql = "INSERT INTO clients SET IDNumber = '". $client[$i]['idnumber']. "',

View Replies !
Inserting Variable Text
I am running a query, and as per the query I am trying to print different text for each record based upon the query. I seem to work on some of them but not all, am I doing this right. Here is the code that I am running when printing out. The $ro is the primary key for the selected records. Code:

View Replies !
Inserting Record From Html Form
i am trying to insert a record into a mysql database with php3 I can't seem to insert data into a decimal 10,3 field..no matter what I enter, 0.00 shows up in the database. almost like it's trying to insert it as text, instead of a value... any ideas?

View Replies !
Inserting Text Into A Html File
I'm building an indexing search engine that indexes via meta tags. What I'd like to do is have a script that could add meta tags to the header section of an HTML file.

I know you can write to either the beginning or end of a file, but how do I search for a specific spot and place the cursor there? There are a lot of pre-existing HTML files that need to be indexed, so having this script will help ten fold.

View Replies !
4.3.10 Inserting Code Invalid HTML
I am in the process of running my site through WC3 validation. I assume the validator at accept cookies and so PHP is attaching &PHPSESSID=lasklijasj09jsad (or similar) to my URLS. The problem is the leading character is a literal & rather than a &amp; and this is stopping the validator telling me my pages are valid.

View Replies !
Php Array Inserted (element By Element) Into Mysql DB
I want each element of the array to be inserted into the database, but only the last
element of the array is inserted... all the elements will echo... any ideas? I'm a PHP newbie... you can probably tell by the code:

View Replies !
Inserting Variable In Eregi_replace String
MY PROBLEM:

I begin by retrieving these three fields from my database:

$storytext = $story['FIELD1']
$picture2 = $story['FIELD2']
$picture3 = $story['FIELD3']

//where $story['FIELD2'] = hello.jpg
//and $story['FIELD3'] = dog.jpg .....

View Replies !
Inserting Php Variables Into Html Form Controls
in ASP I would simply do this, maybe a slight syntax error there.

<input type="text" name="groupname" size="50" value="<%=my_var%>">

What the heck is equiv in php. Have tried settihg value equal my_var and printing the gosh darn thing as well.

View Replies !
Inserting PHP Code Into HTML Generated By A CGI/PERL Script
Is there a way to have PHP code included into HTML generated by a CGI/PERL script? The problem is that the CGI-generated HTML can not be interpreted/parsed by PHP. Unless you know how.

View Replies !
Wnat To Embed Full HTML Page In Email, But Migrating Style From Css Files To Element Style Attributes
My web pages of course use css files, but Webmail services require
style to be in element style attributes.

How do I convert a standard HTML page to HTML suitable for delivery to
webmail services?

Perhaps another way to ask the question is:

How to I walk the DOM and for every element, for every style, set the
element's style attribute to the values that are looked up in the css
file in normal rendering.

Anyone know of any tools, or examples to do this?

View Replies !
Php Variable In Html
How can I do it that it will recognise the php variable $calendar_dir in:

$monthtext1 =
"
<!-- month heading -------------------------------------------->
<table align="center">
<tr>
<td align="left">
<form name="goto" action="$calendar_dir/calendar.php" method="POST">
<table cellpadding="2" cellspacing="0" border="0" bgcolor="#000000"
align="center">
<tr><td>
<table cellpadding="5" cellspacing="0" border="0" bgcolor="#CC0000">
<tr><td width="200">";

the variable contains a directory i set in a config.php and included on
beginning of the document.

View Replies !
Html From Variable
how can i put several form item in a html form into a array to be pass
to php script?

View Replies !
Can You Use Html As Value For Php Variable
Is there a way to use html as a value for a php variable while going
in and out of the php tag?

For example, can you do something like this?

<?php $strHtml = ?>
<p>somehtml here</p>
<?php ; ?>

so that the value of $strHtml equals "<p>somehtml here</p>"

View Replies !
Variable From The Html
I'm use Apache with php in windows. As I've written some php, I can't send the variable from the html. (That means I can't send the value by the "?" follows the ".php" . As the following example, I type the http://127.0.0.1/ctt.php?a=first It also showns "no selection!"

<?
if ($a=="first")
{
echo "First is selected!";
}
else
{
echo "no selection!"
}
?>

Are there any settings in Apache or PHP?

View Replies !
Using Php Variable In Html
I am working on having an url saved in a mysql database called in an html file. Essentially I would like to be able to just save the URLs of videos and call the URLs from a php file and use that in the html that calls the video. I have

<?php
include filepath/geturl.php //$code is the variable name for the url
echo $code; //it displays the url I want. All good so far.
?>

<param name="movie" value=$code></param><param name="wmode" value="transparent"></param>
<embed src=$code type="application/x-shockwave-flash" wmode="transparent" width="300" height="247"></embed></object>

Unfortunately I cannot use the variable $code in the html side of things. Is there a better way to do this?

View Replies !
Variable Use In HTML
I have a situation wherein I have several HTML documents that use a hidden input on a form. Code:

View Replies !
Put A Html Table In A Variable
I want to do the following: I want to draw a table in html (with the echo command) and put that in a variable so I can draw that table via that variable. I got the following (large table ;-) Code:

View Replies !
Passing A Variable To HTML
I have a standard HTML page. After user authetication, i would like to send the user name from MySQL Database to The standard HTML page. The new HTML page will display the name of the user and the common contets for the user.

View Replies !
<%variable%> In Html Template ?
Just playing around with the idea of using a html template page to seperate
the code from design. Very basic example below

<html>
<!-- hello.html -->
<body>
Hello <b><?php echo $message ?></b><br>
</body>
</html>

<?php
//hello.php
$message ="Phillip";
include("hello.html");
?>

However I am sure I have used <%message%> within the html template before
but this time it did not work. Is there something I should set-up in the
httpd.conf so Apache knows <% %> are PHP tags?

View Replies !
Php Variable In Html Drop Down.
Is it possible to define a variable (like a date) and then make it selectable in a dropdown?  For example: Code:

View Replies !
Capture HTML Into Variable
What I would like is to do is capture a pages HTML output into a variable. I'm hoping there's some way to do this along the lines of an if statement. PHP Code:

<?php $code = { ?>
<table>
<tr>
  <td>Row 1 </td>
</tr>
<tr>
  <td>Row 2 </td>
</tr>
</table>
<?php } ?>

View Replies !
Can't Output A Variable To HTML
I have this code on a page:

<p class="appTitle">
<?php echo "$appTitle"; ?>
</p>

But the resulting HTML is:

<p class="appTitle">
</p>

$appTitle is a global variable which I've declared at the top of the
page in a require_once file like this:

$_GLOBALS['appTitle'] = "My App Title";

According to my debugger, $appTitle is defined with the correct value
when execution reaches that point.

I've also tried,

<?= "$appTitle" ?>

However this work fine:

<?php
$appTitle = "My app";
?>
<?= $appTitle ?>

I have a feeling the answer is something totally obvious, and I'm just
not seeing it.

View Replies !
Variable That Holds A Html Form Name
What variable holds the form name when the contents of a html page is submitted to a .php page? I used the post method to send the forms results to the php page. My php script looks like this:

$CName= $HTTP_GET_VARS["form name"];

This is incorrect. There must be a specified variable in .php that holds the name of the form. My html form line looks like this:

<form name="Theory" method="post" action="http://www.mysite.com/JSl/Jschool.php4">

View Replies !
Passing Array As Value Of A Variable (PHP & HTML)
I am developing a web site which requires a set og unique values be
transferred between pages and server many times. There fore i decided
to put the values in an array so that only one reference to the array
is needed ratherthan idividual reference. The situation is like this:

When the page is loaded based on the user input say 6 values are
created like character1="tom", character2="jerry", Character3="micky",
Character4="donald", character5="cat", character6="rat". This to be
preserved for two or three further pages to be loaded based on further
user input. One solution is to create <input>tags with names
Character1, character2, ............character6 and assign values to
each of them. But when the list is enlarged say to 75 values it is
unweildy. So I found that when the page is first created an array is
created like $character=array('tom', 'jerry' , 'micky', 'donald',
'cat', 'dog')and can be assigned to a single input tag. Is it possible
to such a tag like "<input type="hidden" value=$character>". Or is
there any better alternative to this ?

View Replies !
Session Variable Within An HTML Page
I've got a site that is parsing php as HTML. I have a simple form which passes variables to a handler page.

The handler page sets the form variables as session variables and depending on the variables sent by the form, it redirects to an apporpriate landing page. That landing page wil include some of the information set a session variable i.e. first name & surname. Code:

View Replies !
Putting A HTML Variable Into $_Get
I want to put the value of my drop down list into a PHP $_GET variable: This is the html code:

<form action="insert.php" method="post">
<select name="users">
<option value="user1">user1</option>
<option value="user2">user2</option>
<option value="user3">user3</option>

how do i put the value into $_GET["q"] and pass it to my php page that runs a query?

View Replies !
Saving A Variable As A Html Page
im trying to save a variable from a text area as a html page. ie i have got an text input field requesting the name of a file you want to save as and the actualy data itself.
how do i go about saving the file?

View Replies !
HTML - Hidden Variable Within A Form
I have a problem making PHP work to its full. i have installed php 5.x version, apache 1.3.x ver and mysql 3.x version all of them are working fine. i have a problem.... when i pass any hidden variable within a form like in the code below Code:

View Replies !
Pass Variable With Html Link
how can I pass a php varialbe with an onClick= event handler?

View Replies !
Assign A New Value To A Variable Passed From An Html Form
I'm trying to assign a new value to a variable passed from an html form to a php3 script. I'm using an if statement to evaluate variable 3 to see if it is equal to a specific string, if it is I'm reassigning variable 2 to be variable2+variable 3.

if ($question3!="select days")
{
$question2=$question2+$question3;
}

This is the statement. It keeps giving me a parse error and I can't seem to find the right documentation to show me how to combine two string variables.

View Replies !
HTML Variable In Auto Response Form
This formmail works. Auto responds fine. When I change the $my_message variable, from what is listed, to HTML code, it cancels out the latter PHP code(which is the autoresponder). The HTML code I insert into the $my_message variable, includes Javascript functions, which I assume are causing problems with the PHP, because when I remove the JS function, the "color code" in my editor, looks normal, with the latter PHP coding back in place, but it still doesn't work.

Basically, I'm just trying to figure out how to autorespond an HTML email instead of just Text. Code:

View Replies !
Variable Passing To Script To Fill Html
I'm trying to do the above in order to process an image and return the
result to an html image control. It fails and my key suspects are either
the variable that I'm passing in - ImageName - for processing, or the return
data which is done (or not as the case may be) by imagejpeg($img) in the
script, after header("Content-type: image/jpeg").

View Replies !
Assign Variable To A Block Of Html Code
Is it possible to assign variable to a block of html code?
Something like this :

$myblokvar = "<table width="487" border="0" cellspacing="0" cellpadding="0">
<tr> <td><table width="487" border="0" cellspacing="0" cellpadding="0">
<tr> <td><img src="images/bartitle_login.gif " alt="Login" width="475"...

View Replies !
Passing PHP Variable Into An Html Text Field
I am working on a flatfile configuration program and I need to read a single record csv file into php and pre-load the values into html text boxes. I have the file reading part working with 6 variables $field1 through $field6. When I am done, I then save the form back to the same file. This allows a configuration file to be updated from the web.

View Replies !
Load The HTML Output Of A File Into A Variable?
How can i load the html output of a file into a variable.. Kind of like include()ing or require()ing a file.. but not echoing the content.. but saving it to a variable..

Can it be done? I dont want to use fgets because they are PHP files.. and i want to get the HTML as if a user opened with a browser..

View Replies !
Possible To Store The HTML Of An External Site In A Variable?
Possible to store the HTML of an external site in a variable? Code:

View Replies !
Referencing PHP_SELF Variable Within HTML Form - Problem...
I am developing a simple web site that contains a form page. The
apps utilized are apache 2.0.48, php 4.3.4 on redhat 8.0. I have
built a simple web form with one text box and a submit button. The
result of pressing the submit button should be php echo'ing the input
back to the screen. Attached is the tiny code snippet below:

----------------------------------------------
<html>
<head><title>PHP Forms Example</title></head>
<body>
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST">
Type a string: <input type="text" name="myString"><br>
<input type="Submit" name="submit" value="Submit
Journal"><br><br>
</form>
<?php
print "You typed: $myString";
?>
</body>
</html>
----------------------------------------------

The problem I am experiencing is that the print statement doesn't
print anything back to output. If you notice, I changed the reference
PHP_SELF due to 4.2.x modifications in php.ini.



View Replies !
HOW: To Exclude Html Special Chars From Encrypted Url Variable String
I am passing the username and password encrypted in my url strings...

I have discovered that html special characters should be excluded from
the string...specifically the ">" character which when included will
display the rest of the encrypted characters as regular printable
characters on the web page.

Favor 1:
Does anyone know which html chars should be excluded?

Favor 2:
Is there a faster way to check if a character already
exists in a string besides substr()?...(this is for looking for a
character substitute)

Finally : Is there another way to pass parameters opaquely
through an href link?

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved