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 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 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 !
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 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 !
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 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 Into A Database
how do I insert information from a from into seperate tables

View Replies !
Inserting To Database
i have one problem in my website. i have one registration page in which i have several text based fields and 5 upload fields...which will be images.

now what i have to do is that insert all the text based data to a table named product. the images should be inserted to a table named productimage. Code:

View Replies !
Inserting Into Database
I have a small problem which I've been working on for a while. PHP Code:

$query = "INSERT INTO tbl(username,ip,link) VALUES("Brin' . $result['id'] . '","$REMOTE_ADDR","http://www.domain.com/sub/start.php?username=Brin"' . $result['id'] . ' )";
mysql_query($query);

View Replies !
Inserting ' In To A Database
I've been having problems with a form I'm trying to insert in to a database. It borks if I try and insert any query with a ' in.

Basically, I have a form with two fields, one title and one content. They are passed to the database like so:

<?php  $q = "INSERT INTO ".TBL_NEWS." (title, content, username, timestamp) VALUES ('$title', '$content', 'Kemik', '$time')"; ?>

I do use stripslashes() on the variables and then check them via eregi however I'm not sure of any other way to ensure I can submit a sentence such as Why won't this thing work? without breaking the query and ensuring I can display it from the database on to a different php page the same way as I inputted it.

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 !
Inserting Data Into The Database:
I just don't get it, I have searched everywhere and can not find what I am doing wrong. I am familiar with SQL, but I typically use ASP, Access so this MySQL thing is very new. Here's my attempt at inserting data into the database:

// Connection Strings
$username = "-------";
$password = "-------";
$hostname = "localhost";
$dbConnect = mysql_connect($hostname, $username, $password) or die("Unable to connect to the Database, please try again.");
mysql_select_db("database1") or die(mysql_error());
$theSQL = "insert into table (Item1, Item2, Item3) values ";
$theSQL = $theSQL."('".$Item1."','".$Item2."','".$Item3."')"
mysql_query($theSQL, $dbConnect) or die(mysql_error());

I know my connection is good, the problem is with the mysql_query line. I've tried it with and without the $dbConnect and neither works. What am I doing wrong?

View Replies !
Database Inserting Problem
In the database i have 2 fields:

Subject type text
Content type text

My query is something like insert into table_name values ('$subject',
'$content'). These variables are taken using POST from a HTML formular.

the problem is that if i i write into the subject field from the HTML
page "Hello friend" into the database it's inserted only the first word
("Hello"); the same happens with content;

How to overcome this problem?

View Replies !
Inserting Date Into Database
I have a pretty simple news code that inserts the data, and then is retreaved, with a pretty simple scheme. I have a date column set at timestamp(14), and I'm trying to insert NOW() as the date. I browse with phpmyadmin and all it has is 14 zero's. PHP Code:

View Replies !
Wrong $id Inserting Into Database
I'm working on "user comments" for my forums and when someone clicks the users name to go to there profile the url will come up profile.php?id=whatever and the user comments are in the peoples profiles anyways after they submit there comment the insert the profiles id into the column 'id in the database but I don't want that I want the id just to rise in number from 1 to whatever when a user leaves another comment. PHP Code:

View Replies !
Inserting Array To Database
inserting array from form into database. But it give an 'no such index in string error'. I tried $bands[]=HTTP_POST_VARS[band]; and all it does is insert the last value of the array Code:

View Replies !
Inserting Some Data Into Database..
The code I have at the moment creates directories (mkdir) and copys files into them. This seems to work, but I need the variables "$mypath" and "$newfile5" to be inserted into my database. But it won't. It enters the other data such as name and description and creates the folder. Code:

View Replies !
Inserting An Array Into Database
If I have the following problem.

$adults=$_POST['adults'];//lets say its 2
$children=$_POST['children'];//lets say its 3
$rooms =array('101','102');

foreach($rooms as $roomnumber){
$insertSQL = "INSERT INTO bookings (roomNumber, adults, children) VALUES ( '$roomnumber', '$adults', '$children')";
$Result1 = mysql_query($insertSQL) or die(mysql_error());
}
This works BUT..each room gets (say) 2 adults and 3 children whereas I want the numbers spread over each room so that room 101 gets maybe 2 people and room 102 gets 3 people or vice versa and not double -up on the number of overall people. In a real life situation the user would choose the number of rooms and adults etc so the solution would need to allow for this. Can anyone see a way of doing this?

View Replies !
Inserting An Array Into A Database
I'm trying to insert an array into a database along with other information and finding it very difficult.  I want to insert a row into the database for each container that I get from "insert page 1". I get the amount of containers needed

(insert page 1)
<input type="text" name="number_of_containers" size="2">

I use a for loop to make the necessary amount of form fields for two variables and then have two static ones. What I want to do is enter in one row per container. Code:

View Replies !
Inserting A Session In Database
I have a page where users can send a message into the database which eventually the business can log in and  he/she can see, his/her messages. that had been posted to his business,

i am doing it with a session which,  i will call later to display the messages sent to that business my problem is that the $_SESSION['BusinessName']; is not bein taken to page2. I did some testing and it takes other values to page2 but not BusinessName value Code:

View Replies !
Inserting Date In Database
I have form which allows a user to select a date as part of the form.
On submitting i am getting no update to the database and no error message.
To try and test it i created a shorter version which sets up the variables except the date.This gives the same result.ie no update. Code:

View Replies !
Inserting Into Database - GET The Email From The Url
i have a form for newsletter sign up, the customer enters their email in a text field and hits submit, once submit is clicked it process the form in "newsletter.php" I need to  GET the email from the url and then insert it into table newsletter, row "email" heres my messed up code so far.. i don't even know if i'm even close...

<?php

if($_GET['email']!="")
{

$newsletter = 'INSERT INTO newsletter (email) VALUES (".$_GET['email'].")';

}
?>

View Replies !
Inserting Info Into Database
I am trying to realize a function that after a user logged in, he/she can send comments. Hence, I am trying to get the session()'s user_id information, and insert it into the database. But somehow, the user_id could not be retrieved. Code:

View Replies !
Inserting News To Database.
I got this code to insert news to a database. I would like to create an html code using the values in the textarea and then post it into the database. heres my code:

View Replies !
Arrays And Inserting In To The Database
I have a form that uses two arrays one get's a list of courses from the database and one creates dates... i have two questions

1. how do i get the $i and $d value off of the arrays to insert in to the database, but still have each know they belong in the same row?

2. how do i change the dates from a multiselect dates ie, Jun 3, Jun 6, and Jun 12 to 'Jun 3, 6, 12'

here is the snippet of code from my select page. $numposts is a value selected on an earlier page. Code:

View Replies !
Inserting .sql File Into Database
I need PHP to allow me to upload tables.sql to my Database. Here is the code I have so far: Code:

View Replies !
Inserting Image In The Database
I know its not the best way to store mime data in the mysql but the database is designed so i have to go that way. I didnt have the idea to store and retrieve the mime data in the mysql.

View Replies !
Inserting Data Into Database
welll i currently work on a PERL-regEX that filters out the following data out of the dump of a ph ipBB that runs ths standard theme. After the regex i want to put the data into a database. Code:

View Replies !
Inserting Values Into DataBase
I have the problem with inserting several values in one field, from checkboxes (in the field appears only the value of last ticked checkbox). Code:

View Replies !
Script Not Inserting To Database Table
I submit the form to insert the data into the table, when I submit the form for this script to process, The "if" statement is true because the "echo" statement in the else says so, but the else is what the script is doing. Can't figure out why. PHP Code:

View Replies !
Inserting Values Into Database Using Arrays
I'm trying to insert the database the answers to a question and to get the user to select the correct answer. PHP Code:

View Replies !
Inserting An Array Of Photos Into Database
I have a form layed out like so to upload photos and input the file name into the database. Code:

View Replies !
Page For Inserting Information Into A Database
i'm making a page for inserting information into a database...i have the page all set up, and it works, but what i want is a little timer bar, kind of like when you are installing a program on the computer.  i was wondering if there is a way to do that...

it should be pretty fast, but not so fast as to just be pointless, 3 seconds or so i think.

View Replies !
Inserting Data Into Database With Use Of Variables
this code insters data correctly into the 1st table but not the second. I bet a simple modification is required but i cant figure it out - ive tried many things: Code:

View Replies !
Inserting A Null Value Into Mysql Database
i have a form that submits data to a php result page.  i then insert that data into a mysql database.  Null values ARE allowed and the problem is when i try to insert a null number value, it errors.

$ticket_number = $_POST['ticket_number'];
$another_number = $_POST['another_number'];

$query = "INSERT INTO ticket (ticket_number, another_number) values ($ticket_number, $another_number);
mysql_query($query) or die(mysql_error());

ticket number is required, but another_number is not.
error: youg have an error in your sql syntax; check the manual that corresponds to your mysql server version for the right syntax to use near ')' at line 1

the ')' refers to the end of the close parenthasis in the sql statement.  the thing is, in mysql i could have just done:

insert into ticket (ticket_number, another_number) values (1, NULL);

how do i replicate that in a php statement.  the same thing happens with a null date type too.  There has to be a way!

View Replies !
Arrays And Inserting Data In To The Database
I have a form that uses two arrays one get's a list of courses from the database and one creates dates... i have two questions

1. how do i get the $i and $d value off of the arrays to insert in to the database, but still have each know they belong in the same row?

2. how do i change the dates from a multiselect dates ie, Jun 3, Jun 6, and Jun 12 to 'Jun 3, 6, 12'

here is the snippet of code from my select page. $numposts is a value selected on an earlier page. Code:

View Replies !
Isset - Inserting The Information Into My Database?
Ive created a in website mail system for my website, however i am not using a button for the submit. I am using normal text and javascript to submit form which works fine BUT

in order to insert the information into the database im using

if (isset($_POST[''])) {

Now if i was using a button to submit it and had the name as submit i would enter submit into the post area however im not using any names. How would i go about inserting the information into my database?

View Replies !
Inserting Checkbox Data Into A Database
Typically, checkbox inputs have a name value of an array (something like <input name="options[]" type="checkbox" />).  Is there an easy way for me to extract the values of such an array and insert them into the right database column?  Or should I just bite the bullet and give each checkbox input a unique name so I save myself some confusion/readability?

View Replies !
Form Checkboxes - Inserting Into A Database
I have a survey that i am doing, and one of the questions is pick your top two questions out of six answers. When I submit the form how do I know what check boxes they click and how do I know if they clicked three instead of two?

View Replies !
Inserting Data From A Sql Database Into An Array
I am currently working on a project where I need to put information from a sql statement into an array.  Currently I can get one row into the array, but the rest aren't showing.  I have checked, and all of the information is getting to the array, but I can only get one row to show up. 

Here's the code:

  while(($row = mysql_fetch_array($result)))
  {
   $info=array($count=>array('line1'=>$row["first_name"], 'line2'=>$row["last_name"], 'line3'=>$row["product"], 'line4'=>"$".$row["date"]));
   $count++;
  }

I'm trying to get this array to hold multiple rows from the sql statement, but when I display the array, I can only get one row out of it.

View Replies !
Inserting Session Variables Into A Database
I get the following error message when I run the script:

Parse error: syntax error, unexpected T_VARIABLE in C:wampwwwNew Folder (2)process.php on line 24

I am trying to write the session variables to a table called schools in a table called school_users, this all works when I simply put words in 'here' in the MySQL command part of my script. So this shows its all OK, (the POST values also work),  but I think the trouble is when I use this:

$_SESSION['school_name'] in the MySQL command part, that, I think is why I get the error. Help to tell me how to put these in SQL commands or renaming them to $variables Code:

View Replies !
Problem In Inserting Data In Database
i am posting an array from a page, and all my array values are stored in $final variable(see below code). I confirm this by print_r command.

In this variable, i got 5 different ID's, i want to store that id's in database, thats why i put my query in loop.

But the problem i am facing is that i don't know that how to insert $fianl variable value in database. Also it gives error in query. Code:

View Replies !
Inserting File Content In Database
I am trying to get the contents of text/HTML files from my local machine in to a table field in MySQL server. Whether the local file is uploaded to the server is not a concern as long as I am able to (in rare cases) upload (or update the database) with the same file name.

View Replies !
Problem Inserting Text In Database
I have a crawler that will fetch urls from a webpage. The urls are stored in my database. The next time I run the crawler script it checks the page for new urls and adds them to the database. Code:

View Replies !
Inserting New Entry Into Database Via Email
I have seen this at a small blogging website where members are allowed to add new entries to their journal via email. I believe they send it to some specified email address and add their user/pass as the first line of their text entry.

This is quite useful if you are at work or behind a firewall and can only send emails. I was wondering if anyone has ideas about how such a system could be setup. I'm not looking for code necessarily, just semantics, but if you have built such a system, please feel free to post.

View Replies !
Troubles With Inserting The Values Into The Database
Im making a forum system with some others and im having troubles with inserting the values into the database. it just wont add them or display it has so there might be something wrong Code:

View Replies !

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