Community Member Featured
Member Avatar
cereal 1,272 Replied To a Post in string related problem
Topic by ridoy in Programming
php
Hi,

I do not see the conditional statement to apply the comma. Do you have an example of the input? Reply by cereal
Member Avatar
cereal 1,272 Began Watching string related problem
i need soluton about this problem. My problem is here , i submitted my code to codeforces , they expected the result could be ".t.r," but they found my code's result is ".t.r." my code is here so please fix the problem


<?php
for($t=1;$t<=3;$t++){
$yourString = fgets(fopen("php://stdin","r"));
$vowels = array("a", … Topic by ridoy in Programming
php
Member Avatar
Topic by Sumier in Web Development
It is possible. Do you see the requests in the web server logs? Also you can try Postman or httpie:

* https://www.getpostman.com/
* https://httpie.org/

Send a request to the PHP script and see if you get a response. If it works, then it can be your android code. Reply by cereal
Member Avatar
Topic by Pamela_6 in Microsoft Windows
Hi,

enter the bios, change the start up order to read the USB media before than the primary disk, save and restart.

Here you can find more suggestions:

* https://answers.microsoft.com/en-us/insider/forum/insider_wintp-insider_install/performing-a-windows-10-update-everything-seemed/663f38cf-b941-431e-858f-2881c7793ff1?page=1

Bye! Reply by cereal
Member Avatar
I tried to update Windows 10 but I didn't have enough storage so it made me use a flash drive to complete the update. I restarted the computer when it was done, and now it's stuck on a "Please insert external storage media and press OK" error message. I press … Topic by Pamela_6 in Microsoft Windows
Member Avatar
Topic by Sumier in Web Development
> I am not sure where to enter the additional php you provided.

Do not consider it anymore, I thought the request and response was between PHP pages and I was suggesting you to move the client to a landing page. In this case you probably need more an header … Reply by cereal
Member Avatar
Topic by Sumier in Web Development
Okay,

if the register request is sent to another script you have to redirect the client back to a page that can accept GET requests. Which can be the sign in page or the sign up in case the registration failed. So at the end of the script, right after … Reply by cereal
Member Avatar
Topic by Sumier in Web Development
> When I remove the extra bracket, I get this "Parse error: syntax error, unexpected end of file".

I suggested you to move mysqli_close() inside the [statement](http://php.net/manual/en/control-structures.if.php), not to remove the extra bracket. Otherwise you get the syntax error. Reply by cereal
Member Avatar
Topic by Sumier in Web Development
At line 26 there is an extra `}`, but it does not raise a syntax error, so if on top you have a condition like:

if($_POST)
{
# open connection here
# other code ...
} # <-- line 26 in your code
# close connection here

then, when you … Reply by cereal
Member Avatar
I get the error "Warning: mysqli_close() expects parameter 1 to be mysqli, null given in" and I can't find a problem. Can anyone help, here is my code.

$username = $_POST['username'];
$password = $_POST['password'];
$email = $_POST['email'];

$CheckSQL = "SELECT * FROM users WHERE email='$email'";

$check = mysqli_fetch_array(mysqli_query($con,$CheckSQL));

if(isset($check)){

echo … Topic by Sumier in Web Development
Member Avatar
Topic by Latrell_vie in Web Development
php
From the [documentation:](http://php.net/return)

> If called from within a function, the return statement immediately ends execution of the current function, and returns its argument as the value of the function call.

It is like doing:

echo 'hello';
exit;
echo 'world';

so in your function you can store the value that … Reply by cereal
Member Avatar
My code works with echo but if I use return it wount display the wanted data, but i want to use code with return so the data will display wherever the shortcode is inserted and not just at the top as it is with echo. So here are the codes … Topic by Latrell_vie in Web Development
php
Member Avatar
Topic by mady028 in Hardware
Hi Julie,

if the OS set the azerty layout try to press shift and comma to get the question mark. Anyway you should set the keyboard layout to match the keyboard not the language of the OS, see if this helps:

* https://support.microsoft.com/en-us/help/258824/how-to-change-your-keyboard-layout

Also from the Lenovo documentation for your … Reply by cereal
Member Avatar
i just bought a microsoft wireless keyboard and the question mark and coma are both È how do i swap it back to the english version of the keyboard. its driving me insane not being able to use question marks.

thanks Topic by mady028 in Hardware
Member Avatar
Topic by surprino in Community Center
Hi, which version of curl are you using? I don't have the `-W` option and I don't find it in the documentation.

Have you tried the PHP curl library? http://php.net/manual/en/book.curl.php
Also you could use Guzzle: http://docs.guzzlephp.org/en/latest/

An example with Guzzle:

<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Request;

$config … Reply by cereal
Member Avatar
I have a command which I run on linux terminal like below:

curl –W “Authentication: Token r4r4xxxxx” “https://api.com/v1/results?display=true&format=image/jpeg&lang=en” –o image.jpg

And this command will authenticate me from the server and download the image named image.jpg to my local machine from where I am calling this command… But I am looking … Topic by surprino in Community Center
Member Avatar
Topic by McLaren in Web Development
php
Herein lies the ROI. You can get bogged down with that pesky over-optimising. This is particularly true of DIY one-man band merchants like myself. You have to learn when good enough really is good enough and to leave well alone.

Not sure if having loads of apps open on your … Reply by diafol
Member Avatar
cereal 1,272 Replied To a Post in Which Parts Of Php Not To Learn ?
Topic by UI in Web Development
php
**@UI**

Hi!

in addition to previous comments, if you are learning PHP for work, sooner or later you will handle legacy code, you will be asked to add functionalities, not always to port it. You cannot always choose the version to work with. For example, something simple like:

$i = … Reply by cereal
Member Avatar
cereal 1,272 Began Watching Which Parts Of Php Not To Learn ?
Guys,

After getting putoff from php.net to learn php 7 (because it is not beginner friendly) and raoming around youtube for 1.5mnth to learn php and failing to get proper tutorials there, I returned to php.net. Was reading the CONSTANT chapter and really got pissed-off.
Read this page and tell … Topic by UI in Web Development
php
Member Avatar
cereal 1,272 Replied To a Post in php mysql
Topic by Maheshwaran in Web Development
Hi,

what have you done so far? Reply by cereal
Member Avatar
cereal 1,272 Began Watching php mysql
**id Autor Title **

1 xyz DCN


when i click Dcn go to load book pdf url

help me Topic by Maheshwaran in Web Development
Member Avatar
Hello people. I'm looking for FP examples that are very simple (very few lines, one-liners are even better) and that totally look like sorcery to a traditional imperative programmer. Can you help me with that? I want to show some old school programmers who are friends of mine but keep … Topic by G_S in Programming
Member Avatar
cereal 1,272 Replied To a Post in Redirect with Parameter
Topic by gahhon in Web Development
php
Hmm, the session in this case it is not, probably, the best approach: what happens if, in the current session, you open multiple tabs of A.php with different IDs?

A.php?id=123
A.php?id=124
A.php?id=125
...

It would screw up, because the session value would be rewritten by the latest loaded tab. Append … Reply by cereal
Member Avatar
cereal 1,272 Replied To a Post in Redirect with Parameter
Topic by gahhon in Web Development
php
> Whenever I press a button on B.php, the value ID=1 gone.

Can you clarify this? Right now it seems the issue is not related to A.php but just to what happens inside B.php. Reply by cereal
Member Avatar
cereal 1,272 Began Watching Redirect with Parameter
Let's all be examples.
I am redirecting from A.php to B.php with a parameter, let's say it ID=1.
Therefore,

..../B.php?ID=1

And I wanna hold the value of the ID.
Whenever I press a button on B.php, the value ID=1 gone.

Any idea of how can I hold that value ? … Topic by gahhon in Web Development
php
Member Avatar
cereal 1,272 Replied To a Post in php,mysql
Topic by new_coder in Web Development
Right now, change line 13 to:

if(mysqli_num_rows($query_run)>0)

There is also another error here:

$query_run = mysqli_query($query,$db);

The first argument of the function must be the link to the database, the second the query statement. So:

$query_run = mysqli_query($db, $query);

Regarding prepared statements you have to change the approach and use … Reply by cereal
Member Avatar
cereal 1,272 Replied To a Post in php,mysql
Topic by new_coder in Web Development
Hi,

this `mysq_num_rows()` does not exists, you may want to use:

http://php.net/mysqli_num_rows

A part that, don't forget to use prepared statements, otherwise sooner or later you may receive a visit from [Bobby Tables.](http://bobby-tables.com/) Reply by cereal
Member Avatar
cereal 1,272 Began Watching php,mysql
hi im new in php im trying to create a log-in system but i got an error need your help guys


THIS IS MY LOGIN PROCESS

<?php
require 'connect.php';

$employeeno = $_POST['employeeno'];
$name = $_POST['name'];

if(isset($_POST['LOGIN']))
{
$query = "SELECT * FROM tbl_employee_information WHERE employeeno='$employeeno' AND name='$name'";
$query_run = mysqli_query($query,$db); … Topic by new_coder in Web Development
Member Avatar
cereal 1,272 Replied To a Post in What On Earth Is This Outlandish Error ?
Topic by UI in Web Development
php
You're welcome! Look at lines 179 and 187. In the first case you have to close the PHP tag `?>`, in the second case you have:

//Display iFrame.?>

Here the closing tag is hidden by the comment `//`. Reply by cereal
Member Avatar
cereal 1,272 Replied To a Post in displaying image after fetching from database
Topic by janicemurby in Programming
It's line 4:

echo '<td>'.<img src='images/blank_big.jpg' height='150px;' width='150px;' />.'</td>';

The way you are using the concatenation operator (dot operator) is not correct, as `<img ...` is a string, so it must be quoted. Do:

echo "<td><img src='images/blank_big.jpg' height='150px' width='150px' /></td>";

Bye! Reply by cereal