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.





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

Related Forum Messages:
Best Way To Encrypt A Form Posted URL String?
Could someone post some examples with explanations of how to
encode/encrypt a form posted URL and then decrypt it, so that it is
very hard or currently impossible to break?

so, something like

http://localhost/page.php?product=12&price=4.50

would appear obfuscated in my browser display area like:

http://localhost/page.php?Ur7@7892yRyw&wq84y@$y8@$ (or whatever)

View Replies !
How To Parse Posted Variables To Do Preg_match And String Functions
I know how to parse posted variables to do preg_match and string functions. What I am wondering is if there is a way to parse global variables as a function. I am not too famialiar with functions per say, but I need to learn how to master them in order to finish my project. Here is a sample code php

$name = $_POST["name"];
$favorite = $_POST["favorite"];
$time = $_POST["time"];

echo ?>

What I am trying to do is striptags and preg_match the data to cleanse it. I know how to do that on a variable by variable basis, but I have a total of 31 variables that are user inputed. I hear that php5 has a cleanse function built in, but this is on php4..

View Replies !
MySQL Query - Start With The Most Recently Posted And Print Down To The First Posted.
Ok, so I'm trying to get this code:

$query = "SELECT * FROM messages";
$result = mysql_query($query);

while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "ID: {$row['id']} <br>" .
"Date: {$row['date']} <br>" .
"Poster: {$row['user']} <br>" .
"Title: {$row['title']} <br>" .
"Message: {$row['text']} <br><br>";
}

to query the database, but return the data backwards: i.e., start with the most recently posted and print down to the first posted.

View Replies !
Using Referal URL, Getting Posted Data, Passing Posted To Include *HELP*
OK.. here is my problem.. I am using PHP as a frontend for executing (actually including) a vb CGI .exe file the include just does the following right now:

<?php
include("http://localhost/test/make.exe?f=$_GET[f]&f2=$_GET[f2]&step=$_GET[step]");
?>

What I need to do is I have a form that needs to have a "Back" button/link and a "Next" button/link .. If they click on "Back" I want it to pass the "Back" as the say... $GET[do] ... needs to equals "Back" if they click back. If they click "Next" it needs to equals "Next" ..

I thought I may be able to detect what URL it is posting from because it is being posted like this:

URL

This would be fine except I need it to retrieve all the data from the form and I do not know if the PHP would get the data from the entire form if you passed it like this it seems like it would only get the posted info in the link..

Is there a way to make the Links as Buttons or keep them as links and then have the links/buttons submit with the different "Back" or "Next" values?

Pls post code on how to do this and I would greatly appreciate it.. This is giving me a headache trying to figure it out! Thanks a lot!

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 !
Removing Element From Array Using String
I am trying the following based on an example from php.net

<?php

$array_of_items = array ('A','B','C','D');
array_splice($array_of_items, 'B', 1);

foreach ($array_of_items as $array_of_items2)
{
Print $array_of_items2;}?>

I expect the result to be ACD, I am getting BCD, Not sure why.

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 !
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 !
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 !
Converting A Hex String To A Binary String?
I have a situation where I have an 8-byte string which is represented as 16 hex digits. How do I convert a 16 hex digit string to an 8-byte binary string?

I know I can use bin2hex to go from a binary string to a hex string (very useful)but is there a way to go the other direction? Right now I have a solution, which is to use a loop to go through the hex string one byte at a time, but that doesn't seem like a good way to do it. It seems like I should be able to use the pack() command, but I can't get it to work.

View Replies !
Convert Separate String Variables To Simple Regular Expression Element
I need to combine the variable values shown below into a regular expression $composite with a separator of |

Here is an example.

$A = "shoe";
$B = "box";
$C = "wrapper";
$termcrm = "crm";
$sep = "|";

$composite = 'shoe|box|wrapper|crm';

View Replies !
Converting Your URL String
Im pretty sure this is possible. What i want to do is instead of having a URL string of 'siteurl.com/?id=home&action=31&variable=4' to something ike 'siteurl.com/home/31/4'.

View Replies !
HTML Converting
How can I convert HTML into a form that PHP can work with it. For example if I have a HTML code that looks like:

<textarea rows="2" name="S1" cols="20"></textarea>

How can I change the " into single ' ? <textarea rows=&#392;' name='S1' cols=&#3920;'></textarea>

View Replies !
Converting Pdf To Html
I am working on a script that opens email attachments and copies the
contents into the body of the email in html format. Does anyone know
if there is a way to convert pdf files to html on the fly, using php?

View Replies !
Converting HTML To A PDF
I am looking for some advice on converting HTML to a PDF file. I used to use HTMLDOC (easysoftwareproducts.com) on my personally hosted server, because I could install it. However, most web-hosting sites do not allow that.

I found FPDF (Free PDF) PHP library, that allows you to manually draw in text, lines, rectangles, etc. While that is NICE, I am looking for something that my users can create custom templates in HTML and add [TAGS] for populating with database fields. I wish I could use WORD or something, but HTML should be OK for most.

View Replies !
Converting Html To Pdf
does anyone here have a code in coverting ur web broswer to pdf format? or do u call dat html to pdf ...

View Replies !
Converting Html
i want to convert the html content into php content dynamically.

//html code
<html>
<body>how are you?</body>
</html>

the above html code should be be look like this after converting to php

//php code
<?php
$body = how are you?;
?>

View Replies !
Converting Html To Php
I have a web site in html, now I want to have a page or two in php. 1- is it ok to have couple of pages with php extension? while all my old pages remain with .html. if I want to change the extension of all html pages to php is it ok to just write the following code in top of every page and change the extension to php. or just change the html to php. I use Macromedia MX and PHAkt trial.

"<?php //PHP ADODB document - made with PHAkt 3.5.1?>"

I did use a software to convert html page to php page, but it did put tons of echo code in front of every single line of code inside all pages, i did not like it, so i did not use it.

View Replies !
Converting String To DATETIME
What is the best way to go about inserting a DATETIME into my MySQL database via PHP? The scenario is that I have a form where the user will enter a date and time and submit. I want this form to insert a valid DATETIME value into my database. I know how to convert my DATETIME values into Unix timestamps for use in my PHP code, but I'm not understanding how to best handle it the other direction.

Given that the user would be inputting field values as follows:
$month
$day
$year
$hour(24)
$minutes

how do I best construct that into a valid DATETIME value that will go into my INSERT statement?

View Replies !
Converting String To Number
I just begin with php. Does it exists a function to transform a string to a number (like atoi() in C)?

View Replies !
Converting Sha1() To String
I generated sha1() string in order to store a password in the table. But i want to know how to retrive back the original password as a normal string in order to send the password to the users who have submitted the forgotten request. I want to know is there any function that i can retireve the password in normal string form.

View Replies !
Converting A String To A Char
Im taking in a string and i want to convert each individual character to an int and output it Code:

View Replies !
Converting String To Float
I'm trying to convert string to float and my float after conversion is 0 (zero). Here is my code:

$c = $currencies->format($cart->show_total());
echo gettype($c);
echo (float)$c;
$c = 39.59
gettype($c) = string
echo (float)$c; = 0


View Replies !
Converting HTML Characters With PHP
In PHP4 there is a function called:
get_html_translation_table (HTML_ENTITIES);

which enables you to leave some HTML-code as it is, like ë for instance.

View Replies !
Converting A Site From *.html To *.php.
A friend and I are converting a site from *.html to *.php. The site already recognizes the *.php files - and the most current version of PHP is running on the server (*.nix).

We plan to leave the *.html files in place, due to their inclusion in search engine databases and user bookmarks.

Here are my questions, that I would appreciate your help with:

1). Are there any problems or issues that I should be concerned with, considering that I might have both an index.php and an index.html in the directories at the same time (unless there is a better way)?

2). Is there any search-engine-friendly way to add refresh statements (meta or javascript) to some of my html files? If so, please share code example. [I'd only add the refreshes to those pages that are a part of the main site structure - i.e. index.html files in the directories.]

3). If I have to go the parsing html as php method... Is the "AddType application/x-httpd-php .html" statement valid to be in the "current version of PHP's" httpd.conf file? Or, does it need to be like this "AddType application/x-httpd4-php .html" (with the &#394;' included)? Also, is that all that is needed to make PHP parse *.html as *.php? [By the way, I am somewhat aware of the .htaccess method.]

4). Does anyone have any examples of how speed is affected by having the *.html files parsed as PHP files? If so, please share.... [Speed is of big concern...]

I appreciate your help with this. I need to upgrade this site and there are hundreds of pages that are currently in the search engines that I do not want to interfere with.

I know that I can keep the html pages and have them parsed as php, but I have already built much of the new site (with many links) with php extensions. So, I planned to drop the new site in the directories with the old site. Pages that are not a part of the main structure (main, products, contact, news, .... and other index.html pages, I will just change the links in them to point to the new index.php pages -- but the main index.html will have to remain and have links updated and/or refresh code).

I really need to find some straight-forward help with this, so that I can do it in a way that will not hinder the site's standing in the search engines.

View Replies !
Converting HTML To A Picture Using Php
I have a tutorial section on my forum with tutorials on photoshop, imageready, apophysis and stuff like that.  The tutorials have pictures and text and I want people to be able to be able to post the tutorials on their forums with ease, but not in text format. I want them to be able to use a dynamic url that will use php to convert the html page to an image, with an anti-rip watermark in the background.

How would I go about converting the html to (and the pictures) so that the person can make this image. I don't know if I'm explaining this well enough. Basically, I want the person to be able to post an exact replica of the tutorial in picture format.

View Replies !
Converting HTML To XHTML
Been trying to solve this for a couple of days now and just hitting a dead end. I have a WYSIWYG editor on a admin panel in replacement for a textarea box. This is all fine, except my client wants valid XHTML, but the editor produces HTML. So instead of <br /> it produces <br>, etc..... I have created regular expressions using preg_replace to replace things like this but I'm having trouble with this line:

$text = preg_replace('/(<img .*?)("|'| )>/i','12 />',$text);

Now, it replaces <img> tags fine, so that <img src='....' title='....' alt='....'> is converted to <img ........ /> and that is all OK. The problem is that for some reason it also changes <a href='.....'> to <a href='........' /> and I'm not sure why. Can someone either suggest a solution to this regular expression, or perhaps a extention or module that is easy to implement that converts HTML to XHTML.

View Replies !
Converting Two HTML Forms Into One
I currently have a single, small search box in the top right corner of my site (like everyone should). I need to make this search box work with two different search scripts: Site Search and Forum Search. Code:

View Replies !
Converting Table Data From HTML To PHP
I have a problem converting data from a html file, to a 3 way split. (header.php index.php and footer.php, Reason being PHP won't parse the following line,
<table width="37%" border="0" cellspacing="0" cellpadding="0" height="163">
I think it all revolves around the % sign, does anyone have any ideas about how to fix it without limiting the width to X amount of pixels?

View Replies !
Converting MySQL Fields To HTML
I have a VARCHAR(255) field in a MySQL database that contains Carriage Returns and Line Feeds.

I'm trying to display the contents of this field in html with printf, but the CrLf's are being ignored by the printf.

Does anyone know an easy way of parsing a string with CrLf's into HTML?

View Replies !
Converting Rich Text To Html
I want to do is upload a rich text file to the server and have PHP covert the text to format html for the body copy of a page. I was thinking about people just using Word or something like it and save as a rich text, then they upload it.

View Replies !
Converting An Html/php Page To Pdf File
Im using php 4.2.2, and need to convert an page that consist of html and php to and pdf file. Can anyone help me on how I can do this and if it’s possible to do with php 4.2.2

View Replies !
Converting HTML To Word / Excel / Etc.
Based on the information I read in www.php.net on the header command I wrote a dummy test script to try to convert the contents of $stuff to MS Word downloadable format: ....

View Replies !
Converting Site From Static HTML
I currently have a web site I'm maintaining which is consists of around 500 static HTML pages. I have been toying with the idea of coverting it to php so I can implement a CMS.

My main worry is that once I convert it over I will have to then do 500 redirects on the server so that incomming links won't be lost.

View Replies !
Converting String To A Format That Be Mathematically Changed?
I am planning on storing usernames and passwords on people's computers, but I would like them to be encypted. Is there a way I can convert a string to a binary/numeric type so I can multiply that value by a number of seconds? (The seconds will be stored in the database) Also, how could I convert the value back to a string when I divide by the number of seconds stored in the database?

View Replies !
Exploding An Integer String And Converting It To An Array
I am working on a travel specials management system. The 'specials' table in the db has a resort_id fk to the 'resorts' table to identify what resort the special applies to.

The resort entry in the 'resorts' table has fields for room categories - room_cat_1, room_cat_2, etc. I need to have a field in the 'specials' table that identifies what room categories that the special applies to at the particular resort. Code:

View Replies !
Converting Spaces To Underscores And Back In The Query String
I have a page that uses a variable in the query string to determine the output of the page. The query string will have a lot of spaces in it that look ugly when encoded to '%20' so my question is:

If the spaces in the query string were replaced with underscores, how would I replace the underscores with spaces in the page?

View Replies !
Converting FROM Html Entities Inside TEXT VALUE Parameter
I am experiencing some very odd behaviour using a function that converts from htmlentities unhtmlentites() - equivalent to pre-made html_entity_decode() in more recent versions of php. The function works fine, but when I echo inside a form, something goes wrong. Please look at the following code, in particular the output near the bottom.

This is a survey that saves form POST information in a mysql database, that is called back to the, rather long form, to show the user what they have already answered (by outputting answers back to the form). PHP Code:

View Replies !
Testing Htmlspecialchars() PHP Function - Converting HTML Characters
Testing htmlspecialchars() PHP Function - Converting HTML Characters

When data needs to be presented in Web pages, HTML special characters
must be well protected Otherwise, data well not be presented properly,
or the Web will become corrupted. This page allows you to learn and
test the htmlspecialchars() function to protect embedded data in Web
pages.

View Replies !
Converting A Html Code To Pdf In Multi Column With FPDF
I want to output some text to pdf file using FPDF. Outputting a text is good even with multi columns.But what I need is I need that text to be formatted. Like Some text to be bold and italic etc.

I can either make a multi column pdf or a html formatted page to PDF, but I want both of them.I couldnt integrate both the functions and from the forums I found someone refering HTML2PDF, but I also need multi column with it..

View Replies !
Converting Html Code To Real Line Breaks In A Textarea
I am having some trouble with converting html code to real line breaks in a textarea, I have the following code that I gets html code from a database and then puts it into a textarea but the str_replace I am using converts the text but puts the actual characters in the textarea, and doesn't actually turn it into a linebreak. (the br below is reality in triangular brackets!)

$paragraph=$row['paragraph'];
$paragraph=str_replace('br','
',$paragraph);
.....
<textarea name="ud_text" cols="50" rows="15" maxlength="300"><? echo $paragraph ?></textarea>

Perhaps someone can help me with this?

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 !
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 !
Converting A PHP Site To A Total Static HTML Site
What's the best way to convert a PHP site to a total static HTML site? You might wanna ask why I wanna do this. Reason: I would like to create an offline version (without server) for demo purposes. Looking at my current PHP site, I am having problem dealing with this issue.

View Replies !
Converting Html Pages Into Dynamic Pages
I built a website in html, using Dreamweaver. I need to have a database built within these pages and the person who is going to do it told me that they will have to convert all my html pages into dynamic pages (php).

Is it complicated to do this or do I just have to save my pages in php instead of html in Dreamweaver ?

View Replies !
Html Tag In A String
I am trying to be able to take off all HTML tag in a String before display it on the screen. Is there a effective way to do it.

View Replies !
< ? Php $string ? > Within Html Statements?
I'm trying to reduce my code in html by calling a page.php file which blocks out the html for me. I was having a hell of a time since my html wouldn't parse the php code so in page.php I ended and started php and used regular html in between.

my problem is that I'm trying to use a string to lable my blocks of html (you know .... a links menu < home > < go here > < go there > with the $ string lableling each header area. Everything is parsing except for the $ string name --- so I have lots of nested tables with everything filling except the title of the block, Code:

View Replies !
Having A HTML + PHP String Evaluated...
Does any knows if there is some way to have a HTML string with some PHP code included evaluated?

View Replies !
Remove A Html Tag In A $string
I am parsing a rss. While parsing i am getting some  images inside the description. Actually i dont want it. so i try to remove <img tags.

$desc = "this is the sample image <img src='image.jpg'> have a look on it";

I need $desc like "this is the sample image <!-- <image src='image.jpg'> --> have a look on it" any help?

View Replies !
HTML-type String
I'm trying to figure out how to take something like this: Code:

<TAG name="something" title="first">

And extract the information using Regular Expressions so it is put into a multidimensional array like this: Code:

TAG
|--- name -> something
|--- title -> first

Is it possible to do this with one of the PHP preg_* functions?

View Replies !
Replace String Within HTML
We parse our HTML as PHP. All pages within the site are with “.html” extension. We would like to apply additional variable to all internal links within each page. Instead of maintaining manually, we would like to have a script that would automatically: Code:

View Replies !
Find A Html Tag In String
$string=' this is image 1 <img src="www.abc.com/abc.gif"'> and second is <img src="www.df.com/edfg.jpg">;
function getAttribs($t, $a, $s) {
preg_match_all("/(<".$t." .*?".$a.".*?=.*?")(.*?)(".*?>)/", $s, $m);
return $m[2];
}
$arr=getAttribs('img', 'src', $string);

Here i get all the src of <img> tag.

View Replies !

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