Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Jak usunąć rekord z bazy danych, i plik z serwera?
teleimpact
post
Post #1





Grupa: Zablokowani
Postów: 43
Pomógł: 1
Dołączył: 25.01.2009

Ostrzeżenie: (10%)
X----


Witam, szukam kodu który skasuje rekord z bazy danych i usunie plik z serwera...

Mam skrypt hostingu zdjęć, wyświetla link do oglądanie zdjęcia, ale nie ma tam linku do jego usunięcia...
Skrypt zapisuje info o zdjęciu w logach bazy danych i w innej tabeli, np. users.

Jak zrobić żeby wyświetlał się link który skasuje zdjęcie z serwera i usunie wszystkie dane z SQL?(IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
teleimpact
post
Post #2





Grupa: Zablokowani
Postów: 43
Pomógł: 1
Dołączył: 25.01.2009

Ostrzeżenie: (10%)
X----


Jestem początkujący, pomoże ktoś to wstawić? Plik odpowiedzialny za wyświetlanie linków po uploadzie.
Bo cały czas mi wywala jakiś błąd (IMG:http://forum.php.pl/style_emoticons/default/worriedsmiley.gif)

Kod
<if="$mmhclass->image->manipulator == "gd" && is_file($mmhclass->info->root_path.$mmhclass->info->config['upload_path'].$mmhclass->image->thumbnail_name("<# FILENAME #>")) == false && preg_match("/links|viewer/", $mmhclass->input->server_vars['php_self']) == false && $mmhclass->templ->templ_globals['extension'] != "bmp" && $mmhclass->templ->templ_globals['extension'] != "ico"">
    <div style="text-align: center;">
        <b>Notice</b>: Failed to generate thumbnail for image file <b><# FILENAME #></b> because of an internal error.
        <br /><br />
    </div>
</endif>

<if="preg_match("/viewer/", $mmhclass->input->server_vars['php_self']) == false">
    <div style="text-align: center;">
        <a href="viewer.php?file=<# FILENAME #>" class="button1">Pokaż obraz w pełnych rozmiarach</a>
    </div>
    <br />
</endif>

<script type="text/javascript">
if (navigator.userAgent.toLowerCase().indexOf("msie") != -1 && navigator.userAgent.toLowerCase().indexOf("opera") == -1 && parseInt(navigator.appVersion) < 7 && get_cookie("in_explorer_lnkphp") == false) {
    set_cookie("in_explorer_lnkphp", "true", 365);
    alert("Hmm... your browser is not officialy supported.\n\nWe recommened you download a supported browser (e.g. Firefox, Opera, or Safari) or some parts of this page may not function as they should.\n\nContinue at your own risk.");
}
</script>

<table cellpadding="5" cellspacing="0" width="100%">
    <tr>
        <td style="width: 20%;" valign="middle">
            <div style="text-align: center;">
                <a href="<# BASE_URL #>viewer.php?file=<# FILENAME #>"><img src="index.php?module=thumbnail&amp;file=<# FILENAME #>" class="thumbnail" alt="<# FILENAME #>" style="max-height: 125px; " /></a>
            </div>
        </td>
        <td style="width: 80%;">
            <table width="100%" border="0" cellspacing="1" cellpadding="0">
                <tr>
                    <td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 605px" name="option" value="<# BASE_URL #><# UPLOAD_PATH #><# FILENAME #>" /></td>
                    <td>Link do obrazka</td>
                </tr>
                <tr>
                    <td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 605px" name="option" value="&lt;a href=&quot;<# BASE_URL #>viewer.php?file=<# FILENAME #>&quot;&gt;&lt;img src=&quot;<# THUMBNAIL #>&quot; border=&quot;0&quot; alt=&quot;<# FILENAME #>&quot; /&gt;&lt;/a&gt;" /></td>
                    <td>Obraz na www (skala 1:1)</td>
                </tr>
                <tr>
                    <td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 605px" name="option" value="[URL=<# BASE_URL #>viewer.php?file=<# FILENAME #>][IMG]<# THUMBNAIL #>[/IMG][/URL]" /></td>
                    <td>Obraz na forum (skala 1:1)</td>
                </tr>
                <tr>
                    <td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 605px" name="option" value="Thanks to <# SITE_NAME #> for &lt;a href=&quot;<# BASE_URL #>&quot;&gt;Free image hosting&lt;/a&gt;" /></td>
                    <td>Link html do nas</td>
                </tr>
                <tr>
                    <td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 605px" name="option" value="[URL=<# BASE_URL #>][IMG]<# BASE_URL #><# UPLOAD_PATH #><# FILENAME #>[/IMG][/URL]" /></td>
                    <td>Miniaturka na forum</td>
                </tr>
                <tr>
                    <td><input readonly="readonly" class="input_field" onclick="javascript:highlight(this);" type="text" style="width: 605px" name="option" value="&lt;a href=&quot;<# BASE_URL #>&quot;&gt;&lt;img src=&quot;<# BASE_URL #><# UPLOAD_PATH #><# FILENAME #>&quot; border=&quot;0&quot; alt=&quot;<# SITE_NAME #>&quot; /&gt;&lt;/a&gt;" /></td>
                    <td>Miniaturka na www</td>
                </tr>
            </table>
        </td>
    </tr>
</table>


Ten post edytował teleimpact 28.01.2009, 22:50:31
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 15.10.2025 - 05:31