Jump to content

pass codes in textarea box to SQL base


SnakZ

Recommended Posts

ok let say i pull a video from youtube if i post the info into the textarea and pass it into SQL the data/text has then  been change some words have been change or deleted

i know that it's happening before it makes it into the SQL and i know there is a way to make it work just dont know how

i know there is a  way bc if u was to edit your SQL base using phpmyadmin it works fine they use a textarea and a few other things but cant tell just what they are doing to make it work praying someone know a fast way to make it work

 

would think it would be like a onSubmit change all html codes (< > any other) into some other code then change back later before they get put into SQL but not sure how to do this

 

im not the best with php if u dont mind can you give me more info ? lol if not then meh i will work with whatever i can get lol

looked all over the net for this with no luck ty you for your time

Link to comment
Share on other sites

<object width="425" height="350"> into the textarea and it comes back with </object> at the end now do it with

a youtube video and alot change

 

im sure you will find that the code has a "multipart/form-data" this form does have file upload that why its there i just didnt see the need to put it up here

 

it goes from

<object width="640" height="385"><param name="movie" 
value="http://www.youtube.com/v/N77DTYOcX6w?fs=1&hl=en_US"></param>
<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always">
</param><embed src="http://www.youtube.com/v/N77DTYOcX6w?fs=1&hl=en_US" 
type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385">
</embed></object>

 

after submiting alot gets change

<object width="425" height="350" type="application/x-shockwave-flash" data="http://www.youtube.com/v/N77DTYOcX6w"><param name="movie" value="http://www.youtube.com/v/N77DTYOcX6w"></param><!--[if IE]><embed src="http://www.youtube.com/v/N77DTYOcX6w"type="application/x-shockwave-flash"wmode="transparent" width="425" height="350" /><![endif]--></object>

 

and the site code you asked for (note i cut the code down in size for you lol )

<form enctype="multipart/form-data" method="post" action="admin.php?op=videos&op=video_edited&home=$home&id=$id">
video url: <textarea name="video_url" rows="1" cols="70">$video_url</textarea><br />
<input type="Submit">

 

this part does not matter much as the code has already been change by this point  lol just by doing an echo shows me that

$video_url=$_POST['video_url'];

echo "$video_url ";

$query = "UPDATE video_other_source SET title='$title', ep='$ep', text='$text', video_url='$video_url', iframe='$iframe', video_full_url='$video_full_url', uploaded_video='$uploaded_video', text_2='$text_2', video_url_2='$video_url_2', iframe_2='$iframe_2', video_full_url_2='$video_full_url_2', uploaded_video_2='$uploaded_video_2', text_3='$text_3', video_url_3='$video_url_3', iframe_3='$iframe_3', video_full_url_3='$video_full_url_3', uploaded_video_3='$uploaded_video_3', text_4='$text_4', video_url_4='$video_url_4', iframe_4='$iframe_4', video_full_url_4='$video_full_url_4', uploaded_video_4='$uploaded_video_4', text_5='$text_5', video_url_5='$video_url_5', iframe_5='$iframe_5', video_full_url_5='$video_full_url_5', uploaded_video_5='$uploaded_video_5', episode_menu='$episode_menu', descriptionv='$descriptionv', rlanguage='$video_rlanguage', keywordsv='$keywordsv' WHERE id='$id'";
mysql_query($query)

Link to comment
Share on other sites

ok how about this

 

using  htmlentities() can it can change the html coding before the web bowers re-render the coding ?

 

is there a way to put it into the textarea it self ? so it can be coded there before it get pass on ?

i have try a few things but didnt work

 

i try to put =htmlspecialchars didnt work php gave me an error lol

?> <textarea name="video_url" rows="1" cols="70"><?php= htmlspecialchars()?></textarea><?php echo "

 

 

and i try to change it right from the $_POST but didnt work it had already got render ... :(

$video_url = htmlentities($_POST['video_url']);

Link to comment
Share on other sites

ok i found a site that had a code that did work i just have not found out how or why yet i will post the code here and maybe one of you can find the how or why before i do lol

only thing i can think of is bc its being done on the same page and not moving from page to page is why its working idk yet lol

 

http://www.tizag.com/phpT/examples/formfinale.php

<?php
$Fname = $_POST["Fname"];
$Lname = $_POST["Lname"];
$gender = $_POST["gender"];
$food = $_POST["food"];
$quote = $_POST["quote"];
$education = $_POST["education"];
$TofD = $_POST["TofD"];
if (!isset($_POST['submit'])) { // if page is not submitted to itself echo the form
?>
<html>
<head>
<title>Personal INFO</title>
</head>
<body>
<form method="post" action="<?php echo $PHP_SELF;?>">
First Name:<input type="text" size="12" maxlength="12" name="Fname"><br />
Last Name:<input type="text" size="12" maxlength="36" name="Lname"><br />
Gender:<br />
Male:<input type="radio" value="Male" name="gender"><br />
Female:<input type="radio" value="Female" name="gender"><br />
Please choose type of residence:<br />
Steak:<input type="checkbox" value="Steak" name="food[]"><br />
Pizza:<input type="checkbox" value="Pizza" name="food[]"><br />
Chicken:<input type="checkbox" value="Chicken" name="food[]"><br />
<textarea rows="5" cols="20" name="quote" wrap="physical">Enter your favorite quote!</textarea><br />
Select a Level of Education:<br />
<select name="education">
<option value="Jr.High">Jr.High</option>
<option value="HighSchool">HighSchool</option>
<option value="College">College</option></select><br />
Select your favorite time of day:<br />
<select name="TofD" size="3">
<option value="Morning">Morning</option>
<option value="Day">Day</option>
<option value="Night">Night</option></select><br />
<input type="submit" value="submit" name="submit">
</form>
<?
} else {
echo "Hello, ".$Fname." ".$Lname.".<br />";
echo "You are ".$gender.", and you like ";
foreach ($food as $f) {
echo $f."<br />";
}
echo "<i>".$quote."</i><br />";
echo "You're favorite time is ".$TofD.", and you passed ".$education."!<br />";
}
?> 

Link to comment
Share on other sites

im marking this as solved as i think its bc im using php-nuke evo that they may have some type of mod or something that is changing my code (it may think someone is trying to hack it idk lol)

 

as the code above me is the same as what i been using

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.