T3 Softwares
Samarth Electricals Interview Questions and Answers
Q1. Why we use $requested in php
The $requested variable in PHP is used to store user input or data passed through a form or URL.
Used to access user input or data submitted through forms or URLs
Helps in processing and manipulating user input within PHP scripts
Prevents direct access to sensitive data by storing it in a variable
Q2. Database connectivity query in php
Database connectivity in PHP involves establishing a connection to a database server and executing queries to retrieve or manipulate data.
Use PHP's built-in functions like mysqli_connect() or PDO to establish a connection to the database
Execute SQL queries using functions like mysqli_query() or PDO::query() to interact with the database
Remember to handle errors and close the connection after use to ensure security and efficiency
Q3. Explain Get , post methods
GET and POST are HTTP methods used to send data to a server in web development.
GET method sends data in the URL, visible to users
POST method sends data in the body of the request, not visible to users
GET requests are cached by the browser
POST requests are not cached and are more secure for sensitive data
GET requests have length restrictions, while POST requests do not
Q4. Create form in html
Creating a form in HTML involves using the <form> tag and various input elements like text fields, checkboxes, and buttons.
Use the <form> tag to create the form structure
Add input elements like <input type='text'> for text fields, <input type='checkbox'> for checkboxes, and <input type='submit'> for buttons
Use labels <label> to provide descriptions for input fields
Q5. Attributes in php
Attributes in PHP are used to add metadata to classes, methods, or properties.
Attributes are declared using the #[Attribute] syntax.
They can be used to provide additional information about the code.
Attributes can be retrieved using reflection.
Example: #[Route('/home')] class HomeController {}
Q6. Sql query for form
SQL query for submitting form data to database
Use INSERT INTO table_name (column1, column2, ...) VALUES (value1, value2, ...)
Make sure to sanitize user input to prevent SQL injection
Consider using prepared statements for security
Q7. Address in mumbai
Mumbai is a bustling city in India known for its vibrant culture and diverse population.
Mumbai is located in the state of Maharashtra in India
Some popular areas in Mumbai include Bandra, Juhu, and Colaba
The address format in Mumbai typically includes the building name, street name, locality, and pin code
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month