הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   עזרה בטופס php (https://hosts.co.il/forums/showthread.php?t=84300)

israeli 11-08-10 16:50

עזרה בטופס php
 
ב"ה

שלום!

אני רוצה לבנות טופס שיקח רק את הקוד ולא את הכתובת
דוגמא: אני מכניס בשדה בטופס את הכתובת http://yeq.co.il/?to=356T
אחרי שלח הוא יביא רק את הקוד 356T ללא הכתובת

אשמח לעזרה ניסיתי לעשות את זה
עם :<?echo $to; ?>
אבל הוא מביא לי את הכתובת עם הקוד

תודה!

Hagaibl 11-08-10 17:05

PHP קוד:

<?php
if(isset($_POST['submit'])) {
    
// Get the form value
    
$url $_POST['url'];
    
// Get the last code
    
$code end(explode("="$url));
    echo 
"<h1>"$code "</h1><br />";
}
?>
<html dir="rtl">
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=windos-1255">
    </head>
    <body>
        <form action="" method="post">
            הכנס את הURL:<br />
            <input type="text" name="url" /><br />
            <input type="submit" name="submit" value="שלח" />
        </form>
    </body>
</html>

תהנה

~The_Sultan~ 11-08-10 17:15

פותח האשכול, זה PHP בסיסי, תלמד את הבסיס מאתרים כמו וובמאסטר, עדיף לך.. פשוט עם הזמן אתה תלמד יותר ויותר פונקציות ותשלוט יותר בנושא
חגי הקוד שנתת מצויין ומושקע כל הכבוד

Hagaibl 11-08-10 17:25

http://www.phpvideotutorials.com/
מומלץ לחלוטין!
זה אתר אשר מלמד אותך את הבסיס של PHP(בצורה בסיסית) ואף מלמד יצירת קשר ראשונית עם מסד מסוג MySQL.
חשוב לציין שהאתר באנגלית

israeli 11-08-10 17:33

ציטוט:

נכתב במקור על ידי Hagaibl (פרסם 775004)
PHP קוד:

<?php
if(isset($_POST['submit'])) {
    
// Get the form value
    
$url $_POST['url'];
    
// Get the last code
    
$code end(explode("="$url));
    echo 
"<h1>"$code "</h1><br />";
}
?>
<html dir="rtl">
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=windos-1255">
    </head>
    <body>
        <form action="" method="post">
            הכנס את הURL:<br />
            <input type="text" name="url" /><br />
            <input type="submit" name="submit" value="שלח" />
        </form>
    </body>
</html>

תהנה

תודה רבה אחי עוד עזרה קטנה מאוד
איך אני משלב בכפתור שלח במקום כפתור שיהיה תמונה זו
http://www.noproblem.co.il/Resources...d/btn.send.jpg

ממש תודה אחי על הכל!

Hagaibl 11-08-10 18:21

PHP קוד:

<?php
if(isset($_POST['url'])) {
    
// Get the form value
    
$url $_POST['url'];
    
// Get the last code
    
$code end(explode("="$url));
    echo 
"<h1>"$code "</h1><br />";
}
?>
<html dir="rtl">
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=windos-1255">
    </head>
    <body>
        <form name="myForm" action="" method="post">
            הכנס את הURL:<br />
            <input type="text" name="url" /><br />
            <input onClick="document.myForm.submit();" type="image" src="http://www.noproblem.co.il/Resources/Global/Image/Landing/ProfessionCard/btn.send.jpg" />
        </form>
    </body>
</html>

תהנה

SniR-S 11-08-10 18:22

קוד:

<?php
if(isset($_POST['submit'])) {
    // Get the form value
    $url = $_POST['url'];
    // Get the last code
    $code = end(explode("=", $url));
    echo "<h1>". $code . "</h1><br />";
}
?>
<html dir="rtl">
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
    </head>
    <body>
        <form action="" method="post">
            הכנס את הURL:<br />
            <input type="text" name="url" /><br />
            <input type="image" src="http://www.noproblem.co.il/Resources/Global/Image/Landing/ProfessionCard/btn.send.jpg" name="submit" />
        </form>
    </body>
</html>


Hagaibl 11-08-10 18:26

ציטוט:

נכתב במקור על ידי Snir Shamka (פרסם 775018)
קוד:

<?php
if(isset($_POST['submit'])) {
    // Get the form value
    $url = $_POST['url'];
    // Get the last code
    $code = end(explode("=", $url));
    echo "<h1>". $code . "</h1><br />";
}
?>
<html dir="rtl">
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
    </head>
    <body>
        <form action="" method="post">
            הכנס את הURL:<br />
            <input type="text" name="url" /><br />
            <input type="image" src="http://www.noproblem.co.il/Resources/Global/Image/Landing/ProfessionCard/btn.send.jpg" name="submit" />
        </form>
    </body>
</html>


הקוד הזה לא עובד דרך אגב.
לא מתבצע Submit.

~The_Sultan~ 11-08-10 21:39

מה זה לעזאזל INPUT מסוג IMAGE חח

Daniel 11-08-10 22:04

חגי, סניר, אני בטוח שאתם רק רוצים לעזור, אבל אני בטוח שפותח האשכול לא למד כלום מזה שנתתם לו קוד מוכן.
The_Sultan - http://www.google.com/search?hl=en&q...=&oq=&gs_rfai=


כל הזמנים הם GMT +2. הזמן כעת הוא 10:17.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ