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 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 Complete Forum Thread with Replies

Related Forum Messages:
Displaying Html Code On PHP Generated Page
I am trying to create a link page in my php application. this is a page that will display a block of html code that a visitor can copy and paste into their web site to create a link back to mine. My PHP page has a line in it like this:

define('TEXT_INFORMATION', '<html page code is here>');

I have added the html code to create the page as noted above. the page contains a same of the banner image file and the html code that goes alon with it. My problem is that I haven't been able to "quote" the html code so that ir will not be executed.

every time I try to run the application from my web server my page will display two copies of the banner iimage not on banner image and text block like it should. Any suggestions?

View Replies !
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 !
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 !
Inserting Auto Generated Content
I'm looking for a method to put some auto generated content in an auto generated e-mail. Can someone help me and tell me how to get this autput into a string? this is my script sofar. (BTW dont look at the rest of the script because its just for testing purpouse)

<?
$i = 0;
$numb = 1;
$counter = 5;
$formcontent = {
while ( $i < $counter ) {
echo "$numb <br>";
++$numb;
$counter--;
}
}
echo $formcontent;
....................

View Replies !
INserting Perl Script
I'm trying to createa PHP page which will fiurst of all gather output from a form. Then I want it to insert a script (sort of like SSI would), but to append these collected variables to the script name.. so i want it to be something like this..

< insert header.html >
< insert script.cgi?output=somevariable >
< insert footer.html >

the thing i really need to know how to do, is how to collect variables from a form. I suppose putting in SSI tags won't do anything to the PHP page. So whats the syntax as to how to collect sent data.

View Replies !
Inserting Link Into A Table Generated From MySQL
I'm trying to insert a link into a table that is generated through a MySQL Query. Here's the code:

View Replies !
Inserting Data From Array Into MySQL Query Generated By While Loop
Without a doubt this issue is dead simple so please excuse the ignorance. Also not sure what I should search for to find a solution, which must already exist on the forum.

Here is my code without any repetition and it works fine. The id is retrieved from the database and is successfully passed to the query, which I have verified updates the categoryID for the correct row. Code:

View Replies !
Embed Php Generated Html In Another Html Page
I am trying to include some php generated html in a page that is just a standard html file, NOT a php file. I have seen other html pages do this by including an src to the cgi script in script tags, like this:

<script src="http://someurl.com/somescript.cgi"></script>

the html page loads and the script is executed and the returned html is displayed in the calling page. So, I tried this:

<script src="http://someurl.com/somescript.php"></script>

It doesnt work!!

View Replies !
Translate Perl Code To PHP Code.
Can some one transfer this Perl into PHP? It is from the Spreadsheet-WriteExcel. PHP Code:

View Replies !
Source Code Generated - But Still Blank Screen
This is a very odd problem I've run into and I currently have no idea what to do about it despite having looked over the code dozens of times.

I run an RPG online that, among other things, has a character creation system. Without going into any details of the system, I'm trying to add a feature that allows a member to change a skill of the character and reset the skill level of the new skill.

The function of the page may or may not be relevant. The code of the file first checks to see if username and password of the member are set. If they have been set, it checks the mysql database table for that combination. If it finds a record matching both, it generates the first page of the feature (giving a form in which to select skill to change and the new skill). If it doesn't find the record, it generates a page to display a typical "Login Incorrect" error page.

For testing purposes, I simply visit the page (passing username & password in through the URL) and it brings up a blank screen without any warnings or error messages. Upon viewing source, I see that it generated the "exact" html code in full that I wanted it to, but none of it is being displayed in the browser.

View Replies !
Dreamweaver Generated Code To Delete Record
I use the dreamweaver generated code to delete a record, how would i add some code to it to delete the files (images) stored in my../images folder, that are linked to the record being deleted, there field names are photo1, photo2, ect..... and there image names are stored in the database Code:

View Replies !
Audio CAPTCHA - Listen To The Generated Code
I write here because I wasn't sure where else to write... Anyways, I made an Audio CAPTCHA script that might be interesting to some of you. This script makes your visiters listen to a generated audiofile (mp3) to get access to the code. For a working demo and to download the script, go here ....

View Replies !
Code For Save Automatically Generated Barcode
We are generating barcode automatically through code. Now we want to give option for save the barcode for user. Now, we are unable to write a code for saving this barcode.

View Replies !
Using Php Generated Pictures With HTML?
I am able to create images with the use of the GDLIB.
but I am not able to use these images together with HTML. I always get the
message "headers are already sent.

View Replies !
Dynamically Generated HTML
I am trying to fit dynamically generated HTML into a variable so I can mail it out to a recepient. Now - the catch is that the dynamic generated HTML contains nexted regions which mace some heavy duty use of "if" and "while" statements. Here is a code snippet example:

$msgbody = "<a id="top"></a>
<table width="100%" align="center">
<tr><td><span class="style3">$mailinga[analysis]</span></td></tr></table>
<br />"
----> this is where the error occurs - it says unexpected T_IF <----
if I set a semicolon after the quotes above it will not include the stuff below, and I tried other combinations of symbols and googled the issue but no go - please help.
---->:(
if($asnc > 0)
................

View Replies !
PHP 4.4.4 Vs Perl 5.8.7 For Object Oriented Server Code
Have you run into a situation where you had to switch from PHP 4.x.x to Perl 5.x.x in order to get better performance?

I am using an OO approach to PHP for my website's server code. There is one tiny script, with dozens of small objects. Each object is in a separate source file.

It is a bit slow, even when the code doesn't do much DiskIO or MySQL.

My webhost (NetSol) uses PHP 4.4 running on Apache 1.3 and Linux.

I have to option to use Perl 5.8.7. That is the only alternative they give me at this time.

Without doing the rewite, I am trying to determine if I can expect any real improvement in performance.

Have you seen or do you know of such a scenario where you get better performance from Perl than from PHP?

View Replies !
Php File As String Generated To Html
I have a page going on a local server but the pages are going to be hosted on another server, which doesn't support php and MySQL. So basicly have to generate the php files into html files. The pages on the localserver are all based on a template page Main.php?Cat=Home

So this is what I'm trying to do. either...open the php template pages in another file then write them as html or...export the php template as html when viewed.So far all I got to see is resource id # 1 Just a little push on the file handling as a string would be much appriciated.

View Replies !
Special Characters Generated Html
$input3->setAttribute("value","<?php print $_SERVER['REQUEST_URI']; ?>");

<input ... value="&lt;?php print $_SERVER['REQUEST_URI']; ?&gt;">

I just don't want that $lt and $gt appear on the generated html, I want my <?php and ?> back

View Replies !
System() Call Perl Script Return Code 13 ?
I run into major problem here and I still cant get it resolved ?

I tried to execute a perl script using the PHP system call

$haha = system('perl /home/testing/cron_scripts/generate.pl', $retval);

echo "Haha is $haha<br>";
echo "Ret Val is $retval<br>";

The problem is I keep getting $retval = 13 ? But if I were to run them from Command line it works. However the script will take sometime. I am not sure if 13 means the code is running or something ? But the problem is my PHP script just exit !

View Replies !
PHP System To Allow User-generated HTML Profile Pages...
Has anyone created or modified an existing codebase to allow users the option to create personal pages as part of their login profile? I'd love to offers users the potential to upload single HTML pages ++ images for their profile... I suppose this would require:

1. A form to accept the HTML page + images and other content
2. A php script to parse the HTML and remove any headers, and to add site headers
3. The same script to parse out any malicious php or java code
4. ... and to store everything in a database.

Has anyone done this, or have suggestions about how to do it? Are there any codebases out there I should check out?

View Replies !
A Web Development QUICK LINK PAGE (QLP) - HTML, Perl, PHP, JavaScript, AJAX, CGI, Etc.
I've recently organized and even color-coded many of my favorite
bookmarks on WEB DEVELOPMENT (and a few other favorite subjects too)
into what I call QUICK LINK PAGES. These are very condensed, compact
(no graphics), fast-loading pages with a 100+ links to some of my
favorite web sites on a particular subject. I hope you'll give them a
try...

Here's the link...

The easy-to-remember link above gets you to one of the Quick Link Pages
(QLP). The current categories (DIVERSIONS, INVESTING, JAZZ, MACINTOSH,
OPERA, PHYSICS (with ASTRONOMY and MATHEMATICS), SPORTS, WEB
DEVELOPMENT, and WINDOWS) are color-coded on the top of every page.
Just click your favorite category. I hope you'll find a lot to enjoy.
If you find any errors, or have suggestions for additional links or
categories,

View Replies !
Script For Inserting Code
I want to make a script, in wich i write a piece of xml code and it creates it in a specified line of a xml file....

View Replies !
Inserting Adsense Code
I feel pretty stupid having to ask this and the last time I asked a question, which was about my OScommerce it cost me a couple of hundred dollars! Well worth it, but hurt the pocket. See I am a small time nobody who hasn't had but a few sales in the last year and, with only one of those on my new OScommerce site.

Anyway I am trying to figure out how to get the code I have received from Googles Adsence onto my site and cannot figure out how to. Some how in my looking for help I ended up here, so I sure hope there is someone who can tell me where to stick it (hey, not that way) I mean into which files, or file i.e.,

View Replies !
Question Inserting Part Of The Url On Php Code
i would like to have a url wich is half static half dynamic:

(the static part would be "tablerest2.php?brand=")
and the part after the equal would be dynamic

right now i have an autopopulating optionbox, that, when you select an option from the box, the link where you go is calculated by this line PHP Code:

View Replies !
Swap Between Inserting PHP Code Into My XML Document
I am trying to prepare for my third year project which basically
consists of a dynamic web site where people can log in and create
profiles, also being able to administer the site so that statistics
can be obtained, the details of which are irelavent.

I have been learning php & mysql do implement the project and I
"thought" the end product would be in HTML however I have since
learned it must be in XML.
So now I am trying to learn as much XML as I can and am slowly coming
to grips with it. However the link I see between PHP and XML seems
quite fuzzy. As the end result must be in XML it is just a straight
swap between inserting PHP code into my XML document as it is with
HTML or is it more complicated than that?

View Replies !
Inserting Php Code Into Mysql Field
Im trying to display a variable '$downloadimage' which is in my head.php file. I am trying to display this on my page by inserting this code into one of my mysql database fields: -Code: <? echo $downloadimage; ?>

When the page loads there is nothing there (i only have text in the variable at the moment), my html code shows the PHP echo code as text.

View Replies !
Inserting Code Between Items In A Loop
I need to show an evil advertisement after every two loops in order to get rich. I have my "while" loop, simplified for illustration. How to I put a javascript call after each 2 rows?

while($result = mysql_fetch_array( $data ))
{
echo "a bunch of HTML";
echo "<div class="descr">Posted on " . date('D j M Y',$result['posted']);
echo CutText(strip_tags($result['descr'], '<example>'),100);
}

View Replies !
Having Code Problem Inserting Into A Query
Having trouble updating or inserting into a field in the db. Other actions in other pages seems to work correctly. What is my problem here? Code:

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 Code Inside String, Preg_replace
I have a string containing a (possibly large) block of html. I need to
insert code (an image to be precise) right after the last textual
character in the string.

This is, of course, no problem if the end
contains plain text and no html. If the string ends in HTML however, I
need to fiddle around. for example consider that the string ends like
"... lorem ipsum.</p></blockquote>". I need to insert code between
"ipsum." and "</p>".

So what kind of regular expression I need, or is there another way I
have missed, to insert code into the string, right after the last
visible character, but before the possibly following html tags (usually
ending tags such as the mentioned </p> and </blockquote>).

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 !
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 !
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 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 !
ENV Variables In Perl Scripts Called From Perl.
I have a perl script in which I am using a ReadParse routine that parses the
$ENV{'QUERY_STRING'} or $ENV{'CONTENT_LENGTH'}*which are two variables passed
to the script under usual SSI (.shtml) containing form data submitted to the
page from which the script is executed from. Code:

View Replies !
Inserting Php Code With "eregi Replace" Function
A little background...Rather than using an iframe in FCKeditor within my CMS system I located the line of code where I can directly place text that outputs to the correct place within the whole site.(templates stay intact and so forth)

I found this...which BTW is within php tags - also <% main %> is element in seperate template file.

$template = eregi_replace("<% main %>", "$main", $template);

and replaced $main with this and it correctly shows on the site.

$template = eregi_replace("<% main %>", "ABC testing content", $template);

I can also insert image tags to display those as well...but the main thing I want to be able to do is build a seperate page in php (say a calendar for ex.) and include it above between the quotes. I tried the usual include method without any success...so I am sure there might be some syntax I am missing although I didn't get any parse errors.

I can post more code if need be, but I wanted to see if anyone had any possible solutions as I don't want to have to paste a whole page of coding in between the quotes I would like to just "include" it. (may not be possible with the structure of the template var)

View Replies !
2>&1 Arg In Exec(perl.... + "sh: /perl Not Found Error" TIA For Help
I have the following line in a php file:

$msg= exec("perl $scriptPath/insert.pl $d $u $t 2>&1", $returnVal);

Can someone explain the "2>&1" argument?


Second problem, this same line of code when run from the unix command line
returns the following error:

sh: /perl: No such file or directory

I've verified that perl is located in /usr/bin/
/usr/bin is in the environment variable "PATH"
all the directories from php program to the root and back down to usr/bin
have 755 permissions.
if I run the program (insert.pl) from the command line it works
I've tried putting the following in both the php and perl programs:
#!/usr/bin/perl
#!/usr/bin

View Replies !
Html Code Within Php Code
How can I insert HTML code from within a php statement?

eg

if validation
{
html code snippet to display message
}else{
HTML Code snippet to display error page
}
}

View Replies !
HTML To BB Code
How do I convert HTML code to BB Code, primarily the [img] tag and the [url] tag. Here's the code I tried which doesn't seem to work (both [img] and [url] codes are below). PHP Code:

// [IMG] Code
$new_post = eregi_replace("[img]([^[]*)[/img]","<img src="1" border="0">",$new_post);

// [url] Code

I just realized that I don't even have the [url] code anymore.

View Replies !
HTML Code
code that is working

echo'

<input type="button" value="view" onClick="top.location.href= select_product.select.options[select_product.select.selectedIndex].value">'

i want to add target=_blank in the end so that url will open in a new window however i keep trying using different with different ' or ".

View Replies !
HTML With PHP, How I Can Add PHP-code In HTML...
Could you help me. How i can add my PHP script or PHP- code in HTML-file.

View Replies !
Parse PHP Code In .html??
I was wondering if it's possible to parse PHP code in .html documents without requiring root access (since I'm on a virtual server). I want to make a two line call to a log program, but I don't want to have to change all of my .html files to .php.

View Replies !
HTML Code In Eval
I'm currently trying to put some HTML code into a variable and to use
it later.
Any ideas, why TEST1 in the following example displays a link, while
TEST2 only displays a text?

<html>
<head>
</head>

<body>

<!-- TEST1 -->
<a href="www.test.com">this is test1</a>

<br><br>

<!-- TEST2 -->
<?
$teststr="?><a href="www.test.com">this is test2</a><?php";
eval($teststr);
?>

</body>
</html>

View Replies !
HTML Email Can Only See The Code
I create a PHP script like the following to send a form output, but only the html code is shown in the html, really can't find any mistake:

<?
for ($i=0; $i<count($uniEmailArr); $i++) {
$to = stripslashes($uniEmailArr[$i]);
$subject = "testing";
$body = "<b>test</b>";
$headers = "From: Marketing <mktg@co.biz>";
$ret = mail($to, $subject, $headers, $body);}?>

Returns only a message with the body as below: (only subject is correctly inserted in the email) <b>test</b> From: Marketing <mktg@co.biz>

View Replies !
Embed A Php Code Into Html
I want to embed a php code into my html file. But its not showing anything. The same code works when I rename the file as .php

<html>
<body>
<?php echo "hi";?>
</body>
</html>

This code works as hi.php3 but doesn work when I rename file to hi.html.

View Replies !
Put HTML Code From A File
How can I put HTML code that is in a file PHP have any funtion or I have to do it?

View Replies !

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