|
The network is not set up yet. Our employees connect using the Wifi in our office. So should I specify their public IP?
|
|
|
|
|
|
Yes, employees in our office use WiFi to connect to the internet as every employee uses laptops
|
|
|
|
|
Yes, all employees in the office use WiFi to connect to the internet, as all employees have laptops. So we use WiFi
|
|
|
|
|
I want to learn PHP and MySql. How can I start and what is the good resource & tutorial?
|
|
|
|
|
|
Even if you never seen what PHP looks like, you still don't need to focus on reading books and lenthy know-hows. Once you get to grips with the fundamentals, you don't need board prep either.
At the same time, it would be headlong to dive into the coding process without any prior studying.
Yep, any coding language is better learnt in practice, yet it's essential to know the basics.
With that being said, start your reserch with the PHP official website. It provides a great and digestible overview which should be enough to grasp the language fundamentals, even if have no programming experience whatsoever.
Once you've hit the grindstone, you're good to head out into the PHP practice.
Now it’s time to write some PHP code.
Basically, you require only 2 things for this: a development environment to run your PHP scripts and a code editor to write the code.
1. Install a local development environment
First of all, you need an interpreter to make sense of your code and run it (since PHP is a scripting language).
Where do you write code? Development environment. A DE is usually a single program in which all development is done. It usually contains many functions for creating, modifying, compiling, deploying and debugging software. The purpose of the development environment is to abstract the configuration needed to combine the command line utilities into a single module, which will reduce the time to learn the language and increase developer productivity.
IDE
Try each development environment and see which platform you feel most comfortable with:
PHPStorm;
Netbeans;
Aptana Studio;
Eclipse.
Code editors for PHP projects
Sublime Text;
Visual Studio Code;
Atom;
Coda;
jEdit;
Programmer's Notepad;
Komodo Edit.
If you’re not sure which one to go with, try XAMP. It's an easy to install and easy to use Apache distribution containing MySQL, PHP, and Perl.
2. Install a code editor
A code editor is aт editor for creating and editing program source code. It can be a standalone application or embedded in an integrated development environment (IDE).
3. Start coding
Run your IDE, open a browser and type localhost in the URL bar.
You will see the DE’s homepage.
Your PHP scripts must be inserted inside a directory aka webserver root.
<pre>Now open your code editor and paste the following PHP code:
<?php
echo '<h1 style="text-align: center;">Hello World!</h1>';
Save the file inside the htdocs directory as hello_world.php (you can use any file name you want, just be sure to use the .php extension), then go back to your web browser and open the URL:
http://localhost/hello_world.php
Voila, ready!
|
|
|
|
|
need student information project in php
|
|
|
|
|
|
Hey guys!
I have been trying to follow the tutorial by passive income on how to set up ipn simulator and have entered all my details on paypal ipn simulator but when I tried to view my test.txt file, it doesn't show anything... here is my listener.php code:
<?php
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
header("Location: index.php");
exit();
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://ipnpb.sandbox.paypal.com/cgi-bin/webscr');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "cmd=_notify-validate&" . http_build_query($_POST));
$response = curl_exec($ch);
curl_close($ch);
file_put_contents("test.txt", $response);
|
|
|
|
|
piano0011 wrote: tutorial by passive income Assuming you are referring to a CodeProject article, then you should use the forum at the end of the article.
|
|
|
|
|
<pre>I have a folder which has both .HTML and .php files. By default, the .HTML file is loading as expected and also if i click a link to a .php, it will not load the .php file of WordPress. It redirects to the .HTML file again .
Condition:
This is a word press site
As the default, I need to run .html
If I click the link to the .php file it will go running WordPress
Please, anyone, guide me to write a .htaccess file to do that.
What I have tried:
i have intro.html and wordpress files in the same folder. by default intro.html would run then i click index.php, the wordpress will run. </pre>
|
|
|
|
|
|
Hey guys!
I tried to set my timestamp to undefined as 0 and for some of my other tables, this is working but not for others.. Is it possible to do this? I even tried to do something like this in my php code: $date = 0; but that doesn't work all the time...
|
|
|
|
|
hey guys!
I am just wondering, how do I go about in selecting from two tables without joining? Is this possible? I tried to use left join but keep getting sql failed....
|
|
|
|
|
According to the php manual, I should use the mysqli_store_result()first before calling the mysqli_stmt_num_rows, whereas from my experience, I can always use mysqli_num_rows to check if the row exists?
|
|
|
|
|
The mysqli_stmt_num_rows() function accepts a statement object as a parameter and returns the number of rows in the result set of the given statement.
The mysqli_num_rows() function is an inbuilt function in PHP which is used to return the number of rows present in the result set.
|
|
|
|
|
I have read that in order to use mysqli_stmt_fetch, you must use mysqli_stmt_store() first otherwise it won't work, is this correct? I have always been using mysqli_stmt_get_result... I have read the php manual but it sounds almost the same to me except that for the mysqli_stmt_fetch(), you must bind the result first?
|
|
|
|
|
Please how can I use $_SERVER['PHP_SELF'] code to save record and print
simultaneouly using PHP. I need the data been submitted into the database to print on the POS printer. See form action used below. Please assist.
<form method="post" name="form1" action="<?php echo $editFormAction; ?> target="_parent">
|
|
|
|
|
Hi guys
Im struggling with something small. i am watching tutorials on PHP and MYSQL but since the video and now SQL syntax changed.
please check my query if the syntax is correct, it worked fine until i inserted my variable $uh.... not sure if im missing quotes or something.
any help will be appreciated.
Unhealthy
Healthy
';
}
}
}
}
?>
|
|
|
|
|
Your question is meanwhile 10 days old but this might still help.
Quote: i am watching tutorials on PHP and MYSQL but since the video and now SQL syntax changed Don't use videos for learning programming. Most of them are of poor quality and some are telling you even wrong. Use books or web tutorials and read the official documentation for the used languages and functions (PHP: PHP Manual - Manual[^] and the documentation of the used database).
$uh=strtolower($_GET['uh']);
if($uh=='u'||$uh=='h'){ Never use == for string comparison. Use === or PHP: strcmp - Manual[^] to check for identity to avoid type juggling (see PHP: Comparison Operators - Manual[^]).
Always check for error return values and print error messages. This is especially useful with mysqli functions during development because you will get meaningful database error messages that help you finding syntax error in SQL query strings:
if ($result=mysqli_query($link, $sql)) {
if (mysqli_num_rows($result)) {
}
else {
echo 'no results';
}
}
else {
printf("SQL error: %s\n", mysqli_error($link));
}
Because $uh is a string and the healthy_unhealthy field probably too or a single character, you should enclose the value in single quotes in the query string:
$sql = "SELECT food,calories FROM food WHERE healthy_unhealthy = '". $uh . '" ORDER by id";
|
|
|
|
|
You should also escape variable
$_GET - security...
|
|
|
|
|
i am working on php and want to add accordian on every row in that dyanamic data is there but as i add accordian it always showing at tne end of all the rows
|
|
|
|
|
With ?php echo $editFormAction/ $_SERVER['PHP_SELF'] as form action, how can I access the data entered in a form textbox but not submitted into db from another pop up window
|
|
|
|
|
Let us assume that we have the following form.
<?php
echo '<form name="signUpForm1" method="POST" action="'.$_SERVER["PHP_SELF"].'">";
<input name="field1" type="textbox"></input> <?php /* lets say field1 value is "John" */
<input name="field2" type="textbox"></input> /* Lets say field2 value is "Doe" */
</form>
?>
and you wish to use the values from signUpForm1 in signUpForm2. much like below
<form name="signUpForm2">
<?php echo "Welcome ".$_POST[field1]." ".$_POST[field2];
$Username=$_POST[field1]." ".$_POST[field2];
?>
<input type="textbox" name="User Name" value="<?php echo $Username;?>">
While I admit there may be some syntax errors with double and/single quotes, it should basically demonstrate the basic idea.
Just a note, if you use method="GET" then use
$_GET['field1'] or
$_GET['field2']
|
|
|
|