[ Príspevkov: 7 ] 
AutorSpráva
Offline

Užívateľ
Užívateľ
Vypis do iframe z textoveho pola

Registrovaný: 17.06.07
Prihlásený: 20.09.09
Príspevky: 75
Témy: 8 | 8
Bydlisko: Hlohovec
NapísalOffline : 23.06.2007 13:11 | Vypis do iframe z textoveho pola

Ludkovia, mam taku dilemu. Potrebujem spravit nieco take, ako je chat, ale s tym, aby uzivatel napisal len jeden riadok a stlacil enter. To co writol, sa mu automat prehodi do spodneho okna (iframe).


Offline

Užívateľ
Užívateľ
Vypis do iframe z textoveho pola

Registrovaný: 26.07.06
Prihlásený: 20.03.16
Príspevky: 1378
Témy: 90 | 90
Bydlisko: Slovakia-Ko...
NapísalOffline : 23.06.2007 13:47 | Vypis do iframe z textoveho pola

nic ma do toho ale pomali by si si mal uvedomit ze prichadza HTML 5 a ta iframi zevraj uz nemam mat


_________________
CPU: Intel E7200 momentalne default + freezer 7 pro | MB: Gigabyte GA-P35-DS3 rev. 2.0 F14 | RAM: A-DATA 4x1GB EE Vitesta | VGA: ATI Radeon HD4850 Sapphire Dual Slot | Monitor: BenQ E2200HD+17CTX | HDD: WD 3200AAKS + Maxtor 6Y080M0 80GB SATAII + 120GB ATA Barracuda | PSU: Corsair VX450W | Windows 7 Ultimate Sk | REPRO: Logitech X-210
+
IPhone 3GS JB 3.1.3 (new BR)
múdry sa postara o seba ale ešte múdrejši sa postara aj o druhých
Offline

Užívateľ
Užívateľ
Vypis do iframe z textoveho pola

Registrovaný: 17.06.07
Prihlásený: 20.09.09
Príspevky: 75
Témy: 8 | 8
Bydlisko: Hlohovec
Napísal autor témyOffline : 23.06.2007 14:05 | Vypis do iframe z textoveho pola

No ja mam stranku v php a implementovany iframe. A potrebujem zapisy do toho iframe z textoveho pola.


Offline

Užívateľ
Užívateľ
Obrázok užívateľa

Registrovaný: 21.02.07
Prihlásený: 21.02.10
Príspevky: 3984
Témy: 96 | 96
NapísalOffline : 23.06.2007 14:11 | Vypis do iframe z textoveho pola

2. možnosti:
1. vkladáš a čítaš z MYSQL databázy
2. cez Javascript


Offline

Užívateľ
Užívateľ
Vypis do iframe z textoveho pola

Registrovaný: 17.06.07
Prihlásený: 20.09.09
Príspevky: 75
Témy: 8 | 8
Bydlisko: Hlohovec
Napísal autor témyOffline : 23.06.2007 14:17 | Vypis do iframe z textoveho pola

Tominator píše:
2. možnosti:
1. vkladáš a čítaš z MYSQL databázy
2. cez Javascript


A ako by sa to dalo cez javaskript? Nemas nieco? pls

(MySQL mi nepodporuje hosting)


Offline

Užívateľ
Užívateľ
Vypis do iframe z textoveho pola

Registrovaný: 26.07.06
Prihlásený: 20.03.16
Príspevky: 1378
Témy: 90 | 90
Bydlisko: Slovakia-Ko...
NapísalOffline : 23.06.2007 15:05 | Vypis do iframe z textoveho pola

megdesign píše:
A ako by sa to dalo cez javaskript? Nemas nieco? pls

(MySQL mi nepodporuje hosting)

vacsina hostingou maju mysql skus o nu poziadat


_________________
CPU: Intel E7200 momentalne default + freezer 7 pro | MB: Gigabyte GA-P35-DS3 rev. 2.0 F14 | RAM: A-DATA 4x1GB EE Vitesta | VGA: ATI Radeon HD4850 Sapphire Dual Slot | Monitor: BenQ E2200HD+17CTX | HDD: WD 3200AAKS + Maxtor 6Y080M0 80GB SATAII + 120GB ATA Barracuda | PSU: Corsair VX450W | Windows 7 Ultimate Sk | REPRO: Logitech X-210
+
IPhone 3GS JB 3.1.3 (new BR)
múdry sa postara o seba ale ešte múdrejši sa postara aj o druhých
Offline

Užívateľ
Užívateľ
Vypis do iframe z textoveho pola

Registrovaný: 17.06.07
Prihlásený: 20.09.09
Príspevky: 75
Témy: 8 | 8
Bydlisko: Hlohovec
Napísal autor témyOffline : 23.06.2007 17:18 | Vypis do iframe z textoveho pola

kmsa píše:
vacsina hostingou maju mysql skus o nu poziadat


No viem, ze hosting s sql maju, ale ja mam zaplateny hosting bez sql. Inak sa to neda, iba cez sql? Nieje neaky skript, ktori ti zapise do iframe text, ktory si dal do imput type="text"? Nasiel som daco na internete, ale neviem to prisposobit na moju stranku. Funguje to len cez php (bez sql). Spravy sa vpisuju do .text suboru.

<?

$latest = $DOCUMENT_ROOT . "/temp/minichat2.latest";
$archive = $DOCUMENT_ROOT . "/temp/minichat2.archive";
$size = 20;
$nick_size = 20;
$message_size = 256;
$max_word_size = 20;

?>

<table width="120" align="center" border="0">
<tr>
<td>
<p align="center">
<font face="arial,sans-serif"><b><a href="http://www.jibble.org/chatbox.php">minichat 2</a></b></font>
</p>
<p align="center">
<form name="minichat_form" method="POST" action="<? echo $_SERVER['PHP_SELF']; ?>">
<font face="arial,sans-serif" size="2">
<input type="hidden" name="minichat_md5" value="<? if (isset($minichat_message)) {echo md5($minichat_message);} ?>">
Nick:<br>
<input type="text" name="minichat_nick" maxlength="<? echo $nick_size; ?>" size="15" style="font-family: Verdana, Arial, Helvetica, Sans-serif; font-size: 10px"><br>
Message:<br>
<textarea name="minichat_message" cols="16" rows="3" style="font-family: Verdana, Arial, Helvetica, Sans-serif; font-size: 10px"></textarea><br>
<input type="submit" name="minichat_submit" value="Submit">
</font>
</form>
</p>
<p>
<font face="arial,sans-serif" size="1">

<?

// Check to see if the user is trying to post something.
if (isset($minichat_md5) && isset($minichat_nick) && isset($minichat_message)) {

// Replace any new line stuff with a space.
$nick = strtr($nick, "\r\n", " ");
$message = strtr($message, "\r\n", " ");

// Trim leading and trailing whitespace where necessary and remove slashes.
$nick = trim(stripslashes($minichat_nick));
$message = trim(stripslashes($minichat_message));

// Only proceed if the md5 hash of message is not repeated.
if (md5($message) != $minichat_md5) {

// Only proceed if the user actually filled in both fields.
if (strlen($nick) > 0 && strlen($message) > 0) {

// If the fields are too long, then chop them to the limits.
if (strlen($nick) > $nick_size) {
$nick = substr($nick, 0, $nick_size);
}
if (strlen($message) > $message_size) {
$message = substr($message, 0, $message_size);
}

// Remove new line characters from the input.
$nick = str_replace("\n", " ", $nick);
$message = str_replace("\n", " ", $message);

// Enforce the maximum word size by breaking up $message into lines.
$message = preg_replace("/([^\s]{20})/", "$1\n", $message);

// Now we can encode the nick and message into HTML.
$nick = htmlentities($nick);
$message = htmlentities($message);

// Now replace the new line characters in $message.
$message = str_replace("\n", "<br>", $message);

// The IP address of the poster, web cache or whatever.
$ip = $_SERVER['REMOTE_ADDR'];
$time = date("j M Y - G:i:s T");

// Check to see if the 'latest' and 'archive' files exist and can be written to.
if (!is_writable($latest) || !is_writable($archive)) {
// Touch both files.
touch($latest);
touch($archive);
if (!is_writable($latest) || !is_writable($archive)) {
exit("$latest or $archive is not writable. Please check your permissions and try again.");
}
}

// Read every line of the 'latest' file into an array.
$lines = file($latest);
$bottom_index = count($lines);

// Note that each entry takes up 4 lines.
$line_ip = "<!-- $ip -->\n";
$line_nick = "* <font color="#9999ff">Posted by $nick\n";
$line_time = "on $time</font><br>\n";
$line_message = "$message<br><br>\n";

$entry = $line_ip . $line_nick . $line_time. $line_message;

$already_posted = 0;
for ($i = 3; $i < $bottom_index; $i += 4) {
if ($lines[$i] == $line_message) {
$already_posted = 1;
break;
}
}

if ($already_posted == 0) {
// Now rebuild the 'latest' file.
// Start by entering the new entry at the top.
$out = fopen($latest, "w");
fwrite($out, $entry);

// Then write all other entries except the oldest.
if ($bottom_index >= $size * 4) {
$bottom_index = $size * 4 - 4;
}
for ($i = 0; $i < $bottom_index; $i++) {
fwrite($out, $lines[$i]);
}
fclose($out);

// Also append the entry to the archive file.
$out = fopen($archive, "a");
fwrite($out, $entry);
fclose($out);
}
else {
// This avoided a "probably accidental" repost.
}

}
else {
echo "<font color="red">You must fill in both fields</font><br><br>";
}
}
else {
// This avoided a deliberate repost, maybe we should say something?
}


}

// include the latest comments on the page.
if (file_exists($latest)) {
include($latest);
}

?>

</font>
</p>
</td>
</tr>
</table>


 [ Príspevkov: 7 ] 


Vypis do iframe z textoveho pola



Podobné témy

 Témy  Odpovede  Zobrazenia  Posledný príspevok 
V tomto fóre nie sú ďalšie neprečítané témy.

pisanie do textoveho pola pomocou ajaxu

v JavaScript, VBScript, Ajax

1

438

10.08.2009 10:57

awtt

V tomto fóre nie sú ďalšie neprečítané témy.

pridanie textového poľa formuláru (potrebujem opraviť kod)

v JavaScript, VBScript, Ajax

2

543

06.11.2010 18:21

toma-mato

V tomto fóre nie sú ďalšie neprečítané témy.

výpis textu z textového súboru

v HTML, XHTML, XML, CSS

1

607

13.10.2009 16:40

Snacker

V tomto fóre nie sú ďalšie neprečítané témy.

výpis textu z textového súboru

v PHP, ASP

3

1049

14.10.2009 17:50

LooL

V tomto fóre nie sú ďalšie neprečítané témy.

Vypis udajov do pola

v JavaScript, VBScript, Ajax

12

757

27.07.2010 17:50

camo

V tomto fóre nie sú ďalšie neprečítané témy.

[C] Výpis zo súboru do pola

v Assembler, C, C++, Pascal, Java

2

474

05.11.2012 20:53

ado130

V tomto fóre nie sú ďalšie neprečítané témy.

funkcia pre vypis dvojrozmerneho pola v C

v Assembler, C, C++, Pascal, Java

9

1504

10.07.2011 12:47

v.tkac

V tomto fóre nie sú ďalšie neprečítané témy.

algoritmus na vypis pola v danej podobe

v PHP, ASP

1

457

09.05.2011 11:40

stenley

V tomto fóre nie sú ďalšie neprečítané témy.

Prispôsobenie textového okienka...

v HTML, XHTML, XML, CSS

4

594

08.08.2011 19:35

S-player

V tomto fóre nie sú ďalšie neprečítané témy.

Zistenie textoveho suboru

v Assembler, C, C++, Pascal, Java

2

558

12.05.2012 22:18

Siriuse

V tomto fóre nie sú ďalšie neprečítané témy.

kodovanie textoveho suboru

v Ostatné programy

4

402

25.03.2010 0:12

DeaDMan

V tomto fóre nie sú ďalšie neprečítané témy.

Hra z textoveho suboru

v Assembler, C, C++, Pascal, Java

2

412

19.04.2017 7:04

domiha

V tomto fóre nie sú ďalšie neprečítané témy.

Editacia textoveho suboru v PHP

v PHP, ASP

1

570

08.08.2011 17:25

Unlink

V tomto fóre nie sú ďalšie neprečítané témy.

wordress import clankov z textoveho suboru

v Redakčné systémy

1

608

24.06.2011 15:19

don jebot

V tomto fóre nie sú ďalšie neprečítané témy.

c++ načítavanie z textového súboru atď..

v Assembler, C, C++, Pascal, Java

0

661

30.12.2011 17:03

head0r

V tomto fóre nie sú ďalšie neprečítané témy.

C# čítanie jedného riadka z textového súboru

v Assembler, C, C++, Pascal, Java

4

567

27.06.2014 14:08

walther



© 2005 - 2025 PCforum, edited by JanoF