Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9097077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:01:11+00:00 2026-06-17T00:01:11+00:00

Hey is it possible to make three scripts into one with the following code?

  • 0

Hey is it possible to make three scripts into one with the following code?

Can I just move “result” to the first script?

Here are codes:

<?php
error_reporting(E_ALL|E_NOTICE);
$nazwabazydanych = "projekt";

$pesel = mysql_real_escape_string($_POST['pesel']);
$imie = mysql_real_escape_string($_POST['imie']);  
$nazwisko = mysql_real_escape_string($_POST['nazwisko']);
$telefon = mysql_real_escape_string($_POST['telefon']);
$adres = mysql_real_escape_string($_POST['adres']);
$nr_konta = mysql_real_escape_string($_POST['nr_konta']);
$zarobek = mysql_real_escape_string($_POST['zarobek']);

if (!$pesel || !$imie || !$nazwisko || !$telefon || !$adres || !$nr_konta || !$zarobek)

 {
        print "Nie zostały wypełnione wszystkie pola";
        exit;
 }

 if (strlen($pesel) != 11 )
 {
 print "Zły numer pesel! Pesel powinien mieć 11 cyfr.";
 }

 if (strlen($telefon) != 9 )
 {
 print "Zły numer telefonu! Telefon powinien mieć 9 cyfr.";
 }

 if (strlen($nr_konta) != 20 )
 {
 print "Zły numer konta! Numer konta powinien mieć 20 cyfr.";
 }

$db = mysql_pconnect("localhost", "root", "");
if (!$db)  
        {  
        print "Nie można nawiązać połączenia z bazą danych";
        exit;
        }

mysql_select_db("$nazwabazydanych");

$result = mysql_query("CALL dodaj_osobe ('$pesel','$imie','$nazwisko','$telefon','$adres','$nr_konta','$zarobek')"); 
if (!$result) {
    print('');
}
else
{
    print('Dodano nowa osobe');
}



?>

Second code and “thrid”, the third is the same with only 1 change:

<?php
error_reporting(E_ALL|E_NOTICE);
$nazwabazydanych = "projekt";

$pesel = mysql_real_escape_string($_POST['pesel']);



if (!$pesel)

 {
        print "Nie zostały wypełnione wszystkie pola";
        exit;
 }

   if (strlen($pesel) != 11 )
 {
 print "Zły numer pesel! Pesel powinien mieć 11 cyfr.";
 }

$db = mysql_pconnect("localhost", "root", "");
if (!$db)  
        {  
        print "Nie można nawiązać połączenia z bazą danych";
        exit;
        }

mysql_select_db("$nazwabazydanych");

$result = mysql_query("CALL magic_button ('$pesel',1)"); 
if (!$result) {
    print('');
}
else
{
    print('IT WORKS!');
}

?>

The change in third is :

$result = mysql_query("CALL magic_button1 ('$pesel',-11)"); 

Any suggestion, how can I make them into one?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T00:01:12+00:00Added an answer on June 17, 2026 at 12:01 am

    You can call include one PHP file within another using include or require.

    As an example:

    // foo.php
    echo "hello";
    
    // bar.php
    echo "world!";
    
    // helloworld.php
    require('foo.php');
    require('bar.php');
    

    Output

    helloworld!
    

    Aside from that, you’ll have to clean up that big, messy code dump

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey is this possible to make an application which can be used to see
Hey I was just wondering if it is possible to create an executable file
Hey all, I'm just wondering if it is possible to get the name of
Hey, I'm just wondering if it would be possible to convert videos to mp3
Hey, id like to make this as fast as possible because it gets called
Hey so I'm wondering how can I make AtomicInteger a two dimensional array, From
Possible Duplicate: Why does simple C code receive segmentation fault? Hey Everyone, I'm sure
Hey all - is it possible to make an entire linear layout scrollable when
Possible Duplicate: Cocoa: Hide one application Hey, I was wondering if it's possible to
Possible Duplicate: Android ListView, start new activity Hey can someone tell me how I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.