/    Sign up×
Community /Pin to ProfileBookmark

Javascript problems

Hello, i’m building a WYSIWYG html editor… but i have some problem with the image insertion… Please help!

He gets the image location from “add_img.php” in a session.. yeye perhaps you can see that your selves
The main script is to long to write out here so i just Attach it instead… Here comes the “add_img.php” page:

<?php
include”../funk.php”;
if($_POST[vad] == “ladda”){
if(!$_
FILES[file]){
echo”<script>alert(‘Du måste välja en bild att ladda upp.’); history.go(-1);</script>”;
}elseif($_POST[title] == NULL){
echo”<script>alert(‘Du måste skriva in en bild titel.’); history.go(-1);</script>”;
}else{
echo”Success!”;
die();
}
}elseif($_
POST[vad] == “infoga”){
$value = ‘img/bot.gif’;
setcookie(“Bild_Id”, $value, time()+3600, “/”);
?>
<script language=”JavaScript”>
opener.location.reload();
this.close();
</script>
<?php
}
?>
<html>
<head>
<title>Infoga bild</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<style type=”text/css”>
<!–
body {
background-color: #EFEFEF;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
}
a {
font-size: 12px;
}
input.button {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
–>
</style></head>

<body>
<form name=”ladda” method=”post” enctype=”multipart/form-data”>
<br>
<table width=”350″ border=”0″ align=”center” cellpadding=”0″ cellspacing=”0″>
<tr>
<td colspan=”2″ valign=”bottom”><img src=”img/ula_top.gif” width=”350″ height=”9″></td>
</tr>
<tr>
<td width=”80″ style=”border-left: #666666 1px solid; padding:10;”>V&auml;lj
bild:</td>
<td width=”270″ style=”border-right: #666666 1px solid;”><input name=”file” type=”file” class=”button” id=”file”></td>
</tr>
<tr>
<td style=”border-left: #666666 1px solid; padding:5;”><span style=”margin:5; “>Bild titel:</span> </td>
<td style=”border-right: #666666 1px solid;”><input name=”title” type=”text” class=”button” id=”title”></td>
</tr>
<tr>
<td style=”border-left: #666666 1px solid;”>&nbsp;</td>
<td style=”border-right: #666666 1px solid; padding:5;”><input name=”Submit” type=”submit” class=”button” value=”Ladda Upp”></td>
</tr>
<tr>
<td colspan=”2″ valign=”top”><img src=”img/bot.gif” width=”350″ height=”2″></td>
</tr>
</table>

<input type=”hidden” name=”vad” value=”ladda”>
</form>

<form name=”infoga” method=”post”>
<table width=”350″ border=”0″ align=”center” cellpadding=”0″ cellspacing=”0″>
<tr>
<td colspan=”2″ valign=”bottom”><img src=”img/infoga_top.gif” width=”350″ height=”9″></td>
</tr>
<tr>
<td width=”164″ valign=”top” style=”border-left: #666666 1px solid; padding:10;”>V&auml;lj bild: <br>
<center><select name=”infoga” size=”5″ class=”button” id=”infoga” style=”width:144; margin-top:3;”></center>
</select></td>
<td width=”186″ valign=”top” style=”border-right: #666666 1px solid; padding:10;”>Storlek:<br>
<input name=”w” type=”text” class=”button” id=”w” style=”margin-top:3;” size=”3″ maxlength=”3″>
x
<input name=”h” type=”text” class=”button” id=”h” style=”margin-top:3;” size=”3″ maxlength=”3″>
<br>
<input name=”Submit” type=”submit” class=”button” style=”margin-top:43;” value=”Infoga”></td>
</tr>
<tr>
<td colspan=”2″ valign=”top”><img src=”img/bot.gif” width=”350″ height=”2″></td>
</tr>
</table>
<input type=”hidden” name=”vad” value=”infoga”>
</form>
</body>
</html>

[upl-file uuid=9417d133-9029-452d-975b-1c8e01587874 size=11kB]index.txt[/upl-file]

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @Lupus- spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...