WebDeveloper.com - PHP http://www.webdeveloper.com/forum/ Discussion and technical support for using and deploying PHP based websites. en Wed, 24 May 2017 04:11:56 GMT vBulletin 60 http://www.webdeveloper.com/forum/images/misc/rss.png WebDeveloper.com - PHP http://www.webdeveloper.com/forum/ cURL Experiments http://www.webdeveloper.com/forum/showthread.php?363797-cURL-Experiments&goto=newpost Tue, 23 May 2017 22:39:41 GMT Ladies & Gentlemen!

[~~Useless stuff in poor taste deleted. Consider this a warning.~~]

Anyway, this thread is about cURL.
I will try building a unique script based on cURL. But, let's get rolling to learn first!
I have some viral traffic & viral money earning ideas and cURL will impliment them. Stick around and see how deep the rabbit hole is and what comes out of it! (Not joking!). ]]>
PHP uniqueideaman http://www.webdeveloper.com/forum/showthread.php?363797-cURL-Experiments
<![CDATA[Why Associative Array Creation Has "=>" And Numerical Array Not ?]]> http://www.webdeveloper.com/forum/showthread.php?363759-Why-Associative-Array-Creation-Has-quot-gt-quot-And-Numerical-Array-Not&goto=newpost Sun, 21 May 2017 12:24:35 GMT Associative Array

Code:

<html>
  <body>
     
      <?php
        /* First method to associate create array. */
        $salaries = array("mohammad" => 2000, "qadir" => 1000, "zara" => 500);
       
        echo "Salary of mohammad is ". $salaries['mohammad'] . "<br />";
        echo "Salary of qadir is ".  $salaries['qadir']. "<br />";
        echo "Salary of zara is ".  $salaries['zara']. "<br />";
       
        /* Second method to create array. */
        $salaries['mohammad'] = "high";
        $salaries['qadir'] = "medium";
        $salaries['zara'] = "low";
       
        echo "Salary of mohammad is ". $salaries['mohammad'] . "<br />";
        echo "Salary of qadir is ".  $salaries['qadir']. "<br />";
        echo "Salary of zara is ".  $salaries['zara']. "<br />";
      ?>
 
  </body>
</html>


Numerical Array

Code:


<?php     
/* First method to create array. */
$numbers = array( one, two, three, four, five);
       
foreach( $numbers as $value ) {
    echo "Value is $value <br />";
    }
       
    /* Second method to create array. */
    $numbers[0] = "one";
    $numbers[1] = "two";
    $numbers[2] = "three";
    $numbers[3] = "four";
    $numbers[4] = "five";
       
foreach( $numbers as $value ) {
    echo "Value is $value <br />";
    }
?>
     
  </body>
</html>

Look at both code's bold parts on how each different type of arrays create an array.

The Associative Array:
/* First method to associate create array. */
$salaries = array("mohammad" => 2000, "qadir" => 1000, "zara" => 500);


The Numerical Array:
/* First method to create array. */
$numbers = array( 1, 2, 3, 4, 5);

Why one uses "=>" and one not ? Are they not both procedural style ?
Look:
https://www.tutorialspoint.com/php/php_arrays.htm ]]>
PHP uniqueideaman http://www.webdeveloper.com/forum/showthread.php?363759-Why-Associative-Array-Creation-Has-quot-gt-quot-And-Numerical-Array-Not
Numerically Indexed Arrays http://www.webdeveloper.com/forum/showthread.php?363749-Numerically-Indexed-Arrays&goto=newpost Sat, 20 May 2017 12:29:54 GMT Fellow Php Buds,

Do you mind telling me, according to you:

1. How many variables are listed below ? And,
2. How many numerically Indexed Arrays ?

$employee_array[0] = "Bob";
$employee_array[1] = "Sally";
$employee_array[2] = "Charlie";
$employee_array[3] = "Clare";


Thank You ]]>
PHP uniqueideaman http://www.webdeveloper.com/forum/showthread.php?363749-Numerically-Indexed-Arrays
Mysqli issue account login issue http://www.webdeveloper.com/forum/showthread.php?363723-Mysqli-issue-account-login-issue&goto=newpost Thu, 18 May 2017 20:06:42 GMT Hi, I am having an issue with login PHP code, when I enter my correct login information the script is incorrectly saying my login is invalid. Could someone help me fix this problem? I have listed my coding below. Register.php: -The registration is successful and all information that is being... Hi, I am having an issue with login PHP code, when I enter my correct login information the script is incorrectly saying my login is invalid.
Could someone help me fix this problem? I have listed my coding below.

Register.php:
-The registration is successful and all information that is being sent submits to the database.

PHP Code:

<?php
session_start
();
require(
"includes/db.php");
// If form submitted, insert values into the database.
$globaluser $_POST['username'];
if (isset(
$globaluser)){
    
    
// default timezone ////////////////////////
    
date_default_timezone_set("America/Chicago");
    
////////////////////////////////////////////
    
        //escapes special characters in a string
    
$ip $_SERVER["REMOTE_ADDR"];
        
$name $_POST["username"];
        
$email $_POST["email"];
    
$password stripslashes($_REQUEST['password']);
    
$password mysqli_real_escape_string($mysqli,$password);
    
$mdate date("d/m/y");
    
$mtime date("h:i:sa");
    
//Default rank
    
$defaultrank "Member";
    
//////////////
    
    
$mysqli = new mysqli($host$dbuser$dbpass$database);
    
$sql"SELECT * FROM accounts WHERE email = '".$email."'";
    
$sqli=mysqli_query($mysqli,$sql);
    if(
mysqli_num_rows($sqli)!=0)
       {
           
//Return if row exists in database (User already exists)
           
$_SESSION["errors"] = "userexists";
           
header("Location: ./register.php");
exit;
       }
       else {
           
//Complete Registration.
        
$result mysqli_query($mysqli,$query);
    
$query "INSERT into `accounts` (ipaddress, name, email, password, rank, Reg_date, Reg_time)
VALUES ('
$ip', '".$name."', '".$email."', '".md5($password)."', '$defaultrank', '$mdate', '$mtime')";
        
$result mysqli_query($mysqli,$query);
       }
        
        echo 
"Name: " $username " <br/>Email: " $email "";
        if(
$result){
            
//If Success, send to login
            
mysqli_close();
            
$_SESSION["success"] = "complete";
            
header("Location: login.php");
exit;
        }
        else {
        
$_SESSION["errors"] = "sqlfailed";
        
header("Location: ./register.php");
exit;
        }
    }else{
 
?>
            <?php include("includes/Registration_Form.php"); } ?>
          </form>
<?php ?>
          <?php if($_POST["name"]) { } else { ?><p>Already Have an Account? <a href="login.php">Log In</a></p><?php ?>

Login.php:
-This however is for some reason not working properly.

PHP Code:

<?php 
    session_start
();
        require(
"includes/db.php");
                
$mysqli = new mysqli($host$dbuser$dbpass$database);
                 
$email $_POST["email"];
                
$password stripslashes($_REQUEST['password']);
                
$password mysqli_real_escape_string($mysqli,$password);
                      
                
$query "SELECT * FROM `accounts` WHERE email='".$email."' and password='".$password."'";
                      
                
$result mysqli_query($mysqli,$query);
                
$count mysqli_num_rows($result);
                
                
if (
$count == 1){
//Check users RANK then give them a session with their rank and profile details
$myquery mysqli_query($mysqli,"SELECT * FROM accounts WHERE email='".$email."'");
          while(
$row mysqli_fetch_assoc($myquery)){ //start
        
$_SESSION["rank"] = $row["rank"];
        
$_SESSION["username"] = $row["name"];
        
$_session["email"] = $row["email"];
        
header("Location: ./index.php");
        exit;
         } 
//end
         
}
else 
//INVALID USER
{
        
$_SESSION["errors"] = "invalidlogin";
        
header("Location: ./login.php");
        exit;
}
?>

Would be highly appreciated if someone could help me figure out what I am doing wrong.

Thanks in advance! ]]>
PHP wolveriene401 http://www.webdeveloper.com/forum/showthread.php?363723-Mysqli-issue-account-login-issue
I can not display data http://www.webdeveloper.com/forum/showthread.php?363717-I-can-not-display-data&goto=newpost Thu, 18 May 2017 13:00:23 GMT Hello to everyone!! and forgive me because I am still new to PHP development.
My issue is:

I have 2 tables, cover and lamination which have almost the same structure. So I tried to select the id's from both tables and then make some compare with if statement.
PHP Code:

$get_lamination $mysqli->query("SELECT a.id , b.id FROM $table_lamination a , $table_cover b ");
                while(
$row =  mysqli_fetch_array($get_lamination)) {
                    
                      echo 
"the cover id is"$row['b.id'] . "id"
                     
?> 

But the thing is that I can't display the cover id with the code you see.
Please guide me.
Thank you again so much! ]]>
PHP Fotis http://www.webdeveloper.com/forum/showthread.php?363717-I-can-not-display-data
mysql php search engine http://www.webdeveloper.com/forum/showthread.php?363691-mysql-php-search-engine&goto=newpost Wed, 17 May 2017 15:23:21 GMT Hi so I'm trying to do a search engine where they sear the site for stuff and when they sear it comes up with a link to a page on my website so its like an inhouse search engine.... I have just ran the mysql connect and db connect and it is all connected fine but when i try to grab data from the search engine it just comes up with This page isnít working

(website name) is currently unable to handle this request.
HTTP ERROR 500......

this is on my index page..

<div class="searchbar">
<form action="search.php" method="get">
<input type="text" name="query" placeholder="Search....." size="20"/>
<input type="submit" value="Search"/>
</form>
</div>

and this is the search.php.
<div class="searchbar">
<form action="search.php" method="get">
<input type="text" name="k" size="20" value="<?php echo $_GET['k']; ?>"/>
<input type="submit" value="Search"/>
</form>
</div>

<?php

$query = ($_GET['query']);

$db_host = "localhost";
$db_username = "pubadmin21";
$db_password = "00000";
$db_name = "pubdata21";

@mysql_connect ("$db_host","$db_username","$db_password") or die ("could not connect to mysql");
@mysql_select_db ("$db_name") or die ("No database");

$query = mysql_query("SELECT * FROM search WHERE title = '.$search.'");
if(mysql_num_rows($query) =>1 {

while($a = mysql_fetch_array($query)) {
echo "<a href='".$a['link']."'>".$a['title']."</a><p>".$a['description']."</p>";

} else {

echo "No results found!";
}
?> ]]>
PHP supersimon21 http://www.webdeveloper.com/forum/showthread.php?363691-mysql-php-search-engine
mysql not working with php http://www.webdeveloper.com/forum/showthread.php?363637-mysql-not-working-with-php&goto=newpost Tue, 16 May 2017 11:27:19 GMT I currently run two servers, Tomcat and regular Apache. Java/Tomcat works perfectly with mysql. As seen here: Tomcat (http://92.236.70.82/) However if I try to run mysql on my normal apache server which is located here: Apache (http://92.236.70.82:81/) I get an error which you will see when u... I currently run two servers, Tomcat and regular Apache. Java/Tomcat works perfectly with mysql. As seen here: Tomcat

However if I try to run mysql on my normal apache server which is located here: Apache I get an error which you will see when u visit the link. Help much appreciated! ]]>
PHP evo4ever http://www.webdeveloper.com/forum/showthread.php?363637-mysql-not-working-with-php
<![CDATA[Grab entire row of mysqli->prepare method]]> http://www.webdeveloper.com/forum/showthread.php?363609-Grab-entire-row-of-mysqli-gt-prepare-method&goto=newpost Sun, 14 May 2017 19:36:52 GMT I am trying to set up a login section on my website (before register), and I am trying to grab the entire row by SQL (I don't want to list out the 20+ possible fields). Currently, I try to grab just the Email, but when I echo it- there is nothing on the screen (though I modified to code to remove that portion, and database login portions).

Code:

<?php
//Connect to ComputerParts Database
$Users = new mysqli('xxxx', 'xxxx', 'xxxx', 'xxxx');
if($ComputerParts->connect_errno > 0){
    die('Unable to connect to database [' . $db->connect_error . ']');
}
$Username = $_Post["Username"];
$Password = $_Post["Password"];
//Send comment
$sql = $Users->prepare('SELECT * FROM UserDatabase WHERE Username = ? AND Password = ?');
if (false === $sql){
        die('Prepare() failed: '. htmlspecialchars($Users->error));
}
$msql = $sql->bind_param("ss", $Username, $Password);
if (false === $msql){
        die ('bind_param failed: '. htmlspecialchars($sql->error));
}
$msql = $sql->execute();
if (false === $msql){
        die ('execution failed: '. htmlspecialchars($sql->error));
}
$sql->bind_result($Result);
$sql->fetch();
?>

]]>
PHP PCEntrails http://www.webdeveloper.com/forum/showthread.php?363609-Grab-entire-row-of-mysqli-gt-prepare-method
How To PrecedeTracker Url http://www.webdeveloper.com/forum/showthread.php?363601-How-To-PrecedeTracker-Url&goto=newpost Sun, 14 May 2017 01:38:51 GMT Bro,

Do me a favour.
Follow the following steps and give me your results:

1. Fire-up Xampp.
2. Create a folder "PROXY" in the "localhost". Then, create file: test.php
3. Add the following code into test.php:

https://github.com/joshdick/miniProx.../miniProxy.php

4. Test the proxy script by navigating over to: C:\Xamp\htdocs\PROXY\test.php

What do you see ?
You see a page that looks like this:

**Welcome to miniProxy!**

**miniProxy can be directly invoked like this: http://localhost:80/proxy/test.php?h.../example.net**

**Or, you can simply enter a URL below:**

5. Type the following url to proxify it:
http://localhost:80/proxy/test.php?h...oggerbook.com/

Now, hover your mouse over the "About the Book" but don't click it. What does the url get shown as ?
It gets shown as:
http://localhost:80/proxy/test.php?h...ook.com/about/

Note that the original url is:
http://probloggerbook.com/

But it gets shown to you by preceding: http://localhost:80/proxy/test.php?.

In other words, no matter what url you view via the proxy, it gets proxified by preceding "http://localhost:80/proxy/test.php?" onto the url. Like so:

http://localhost:80/proxy/test.php?h...oggerbook.com/
http://localhost:80/proxy/test.php?http://ebay.com/

Those sites you are viewing do not host your http://localhost:80/proxy/test.php? links nor precede it but your proxy itself does it.
Now, as you can see the proxy is preceding "http://localhost:80/proxy/test.php?" in order to proxify your chosen url. But my idea is, instead of getting it to precede "http://localhost:80/proxy/test.php?", why don't we get it to precede "http://localhost:80/proxy/tracker.php?" instead. That way, our proxy tracker page script gets preceded and clicked in order for the tracker to log the user's clicked url (foreign domain) before forwarding the user to the proxified page http://localhost:80/proxy/test.php?somedomain.com.

Now, can you figure-out which part of the code to replace with what to get the script to start logging ?
I mean, which part in the script do we make changes so the script no longer precedes http://localhost:80/proxy/test.php?
but precedes instead:
http://localhost:80/proxy/tracker.php?
that redirects the user to:
http://localhost:80/proxy/test.php?somedomain.com

In short, the script should not directly forward the user to the proxified page (the page user wants to view) but forward him to the tracker page in the middle as a doorway page before redirecting to the final destination.

Anyone are welcome to make replies! ]]>
PHP uniqueideaman http://www.webdeveloper.com/forum/showthread.php?363601-How-To-PrecedeTracker-Url
Error: Use of undefined constant RETURNTRANSFER http://www.webdeveloper.com/forum/showthread.php?363589-Error-Use-of-undefined-constant-RETURNTRANSFER&goto=newpost Fri, 12 May 2017 14:17:54 GMT Hi,

Does anyone have a clue why I get the following error in my further following code ?

Notice: Use of undefined constant RETURNTRANSFER - assumed 'RETURNTRANSFER' in C:\xampp\htdocs\test\curl.php on line 27

Warning: curl_setopt() expects parameter 2 to be integer, string given in C:\xampp\htdocs\test\curl.php on line 27

You are welcome to rectify the code where I'm goign wrong and then show me how it should have been.
I actually, copied this from a youtube tutorial and they don;t get any errors but I do! Absurd! I copied it while I was learning the basics of cURL.

Code:


<?php

// Youtube Channel: Clever Techie; Video: PHP cURL Tutorial - Learn PHP Programming.

// 1). Create cURL resource.
$curl = curl_init();

// 2). Set cURL options.
curl_setopt($curl, CURLOPT_URL, 'http://www.google.com');

// 3). Run cURL (execute http request).
curl_exec($curl);

// 4). Close cURL resource.
curl_close($curl);


// 1). $curl is going to be data type curl resource.
$curl = curl_init();

$search_string = "movies 2017";
$url = "https://www.amazon.com/s/field-keywords=$search_string";

// 2). Set cURL options.
curl_setopt($curl, CURLOPT_URL, 'https://www.amazon.com');
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, RETURNTRANSFER, true);

// 3). Run cURL (execute http request).
$result = curl_exec($curl);
preg_match_all("!https://images-na.ssl-images-amazon.com/images/I/[^\s]*?._AC_US_160_.jpg!, $result, $matches");

//Use either one of the following 4 codes. (Use one by one in order to test and learn).

//code 1:
print_r($matches);

//code 2:
$images = array_unique($matches[0]);
print_r($images);

//code 3:
$images = array_values(array_unique($matches[0]));
print_r($images);

//code 4:
$images = array_values(array_unique($matches[0]));
for ($i = 0; $i < count ($images); $i++) {
    echo "<div style='float:left; margin: 10 0 0 0; '>";
    echo "img src='$images[$i]'><br />";
        echo "</div>";
}

// 4). Close cURL resource.
curl_close($curl);

?>

]]>
PHP uniqueideaman http://www.webdeveloper.com/forum/showthread.php?363589-Error-Use-of-undefined-constant-RETURNTRANSFER
Recommend Me Some Tutorials On How To Build My Own Proxy http://www.webdeveloper.com/forum/showthread.php?363587-Recommend-Me-Some-Tutorials-On-How-To-Build-My-Own-Proxy&goto=newpost Fri, 12 May 2017 14:07:53 GMT Guys,

Does anyone have any php tutorials (either text or video) to recommend to me to learn how to build my own php proxy ? You see, I'm actually trying to give you a frame on my website where you can use that to navigate to websites. I want to be able to track what websites and webpages you visit either by typing direct the url or by clicking links. Don;t ask me why would any visit use such a frame only to be tracked because that's a long story. I just need your suggestions on the technical parts.
I was suggested to look into url_rewriting which I am looking into now and was suggested MiniProxy which seems to be doing the job I wanted.
https://github.com/joshdick/miniProxy

However, saying all this, I need to learn how to build such a proxy and so on the lookout for upto date tutorials. Youtube is yielding a lot of outdated tutorials on cURL and hardly any vids show you how to program/write your own php proxy. I tried understanding the codes that made-up the miniProxy but it's seeming too complicated for a beginner. Having to do a lot of guess work which part of the code does what and that is not a proper way to learn. Thefore, hunting the perfect beginner level tutorial.

Any suggestions welcome!

PS - Looking also for proper upto date tutorials on url_rewriting. No, php.net I can use as a reference but not a good place to start learning for a beginner!

Thanks! ]]>
PHP uniqueideaman http://www.webdeveloper.com/forum/showthread.php?363587-Recommend-Me-Some-Tutorials-On-How-To-Build-My-Own-Proxy
Can Php Force Viral LIKES/SHARES Or LOCK/UNLOCK Pages, Contents, Images, etc. ? http://www.webdeveloper.com/forum/showthread.php?363495-Can-Php-Force-Viral-LIKES-SHARES-Or-LOCK-UNLOCK-Pages-Contents-Images-etc&goto=newpost Mon, 08 May 2017 00:58:22 GMT Guys, Have you seen those viral social network SHARING scripts or viral social network LIKING scripts or viral content locking scripts or viral contest scripts ? You know the ones that force you to LIKE or SHARE a webpage in order for you to unlock the remaining content of the page or in... Guys,


Have you seen those viral social network SHARING scripts or viral social network LIKING scripts or viral content locking scripts or viral contest scripts ?
You know the ones that force you to LIKE or SHARE a webpage in order for you to unlock the remaining content of the page or in order for you to get access to a download page, etc. Do you know if they're built with php or not ? I once found one (free) built with javascript. The downside was, it didn't track whether you LIKED/SHARED the concerned page or not.
Now, I want to learn how to build such scripts to add a feature onto my social network. Few months ago, I was hunting to buy one of these scripts but then gave-up as was planning on building my own with php. But tonight, I'm wondering if they're built with php atall. Because, if they're not then I'm wasting my time dreaming and so best I buy one of them. I'm listing a few below for you to get an idea what I'm talking about. Note I am listing no affiliate/referral links.

In other words, I want to build a script where if you want something from a member of my sn (like get added as his friend or follower or gain rights to mssg him or download his stuffs like ebook, softwares, or gain access to his records/stats, etc.) then you're gonna have to facebook LIKE his blog or facebook LIKE his fan page or facebook POST or digg his post or tweet about his webpage or retweet his tweet or G+ his pages. In other words, I want the script to force you to SHARE/LIKE his webpage on other social networks). That way, the member gets viral traffic. And you too.

So, is all this do-able with php ? If so, which function ? I know partly curl would do the job but anything else too ?
Which aspect of php should I concentrate on ?
:confused:

https://codecanyon.net/item/viral-lo...unlock/1632879
https://codecanyon.net/item/facebook...ial-app/717030

http://viralrefer.com/
http://sharethiscontest.com/features.php
http://www.super-tell-a-friend.com/s...riend-demo.php


I haven't checked the ones listed on the following page yet but will do after I wake-up. Need to go to bed. You are welcome to check them out and let me know which ones you'd stay away from and which ones you like. That would be feedback for me, should I decide to buy any of them.
One last question, these scripts usually do not come encrypted. Right ? I mean, I'd like to peeping tom over their source code to gain work experience.

PS - More than 6 months back, I built an .exe bot that would force you to tweet about my chosen link. It would check your tweeting page whether you've made the tweet or not. If not, then it won't function. Else, would. Trying to now build something like that with php.
I think if I learn curl then I can get the script to check whether you've made the tweet or not. Get the script to check whether a certain html element or text exists on a page or not. But, I have no clue how to get it to force you to LIKE and SHARE others' pages or how to get the script to LOCK/UNLOCK any content.
I get the feeling, the LOCKING/UNLOCKING is done with javascript. Correct ?

PPS - I downloaded the following free script. Do you reckon it is safe and sound to learn from it's source code ?
http://www.mediafire.com/file/emk3wb...are+script.rar


Thank you for your time and effort! ]]>
PHP uniqueideaman http://www.webdeveloper.com/forum/showthread.php?363495-Can-Php-Force-Viral-LIKES-SHARES-Or-LOCK-UNLOCK-Pages-Contents-Images-etc
PHP - Sorting and grouping values of a multidimensional array in multi-file upload http://www.webdeveloper.com/forum/showthread.php?363493-PHP-Sorting-and-grouping-values-of-a-multidimensional-array-in-multi-file-upload&goto=newpost Sun, 07 May 2017 23:07:21 GMT "; print_r($_FILES);]]> I have the following form that when sending with multiple images generates a multidimensional array with all the data ordered by default.

Form HTML and PHP:

PHP Code:

<?php
if(array_key_exists('send'$_POST)) {
    echo 
"<pre>"print_r($_FILES);
}
?>

HTML Code:

<html>
    <body>
        <form enctype="multipart/form-data" action="" method="POST">
            <input name="image[]" type="file" multiple />
            <input type="submit" name="send" value="Send" />
        </form>
    </body>
</html>


Sending it generates an array of this type:

PHP Code:

$file1 = array(
    
'imagen' => array(
        
'name'      => array(
            
'Image_name',
            
'Image_name'
        
),
        
'type'      => array(
            
'jpg',
            
'jpg'
        
),
        
'tmp_name'  => array(
            
'jpg',
            
'jpg'
        
),
        
'error'     => array(
            
0,
            
0
        
),
        
'size'      => array(
            
'200',
            
'200'
        
)
    )
); 


I need to sort the data with PHP and foreach cycles preferably from this array in a simpler way and the values can be together.

Expected output:

PHP Code:

$file2 = array(
    array(
        
'name' => 'Image_name',
        
'type' => 'jpg',
        
'tmp_name' => 'jpg',
        
'error' => 0,
        
'size' => 200
    
),
    array(
        
'name' => 'Image_name',
        
'type' => 'jpg',
        
'tmp_name' => 'jpg',
        
'error' => 0,
        
'size' => 200
    
)
); 

Thanks for your help ]]>
PHP funcion http://www.webdeveloper.com/forum/showthread.php?363493-PHP-Sorting-and-grouping-values-of-a-multidimensional-array-in-multi-file-upload
How Come Variable Not Assigned And Php Knows Where To Look For Value ? http://www.webdeveloper.com/forum/showthread.php?363477-How-Come-Variable-Not-Assigned-And-Php-Knows-Where-To-Look-For-Value&goto=newpost Sat, 06 May 2017 12:18:02 GMT Good Weekend Folks! I have a question. I do not understand how php knows how to define this variable $value in the following example since it has not been declared. How does it know what that variable represents since no reference or pointer has been assigned to it ? Strange! ... Good Weekend Folks!


I have a question.
I do not understand how php knows how to define this variable $value in the following example since it has not been declared. How does it know what that variable represents since no reference or pointer has been assigned to it ? Strange!

https://www.tutorialspoint.com/php/php_arrays.htm

Code:


<html>
  <body>
 
      <?php
        /* First method to create array. */
        $numbers = array( 1, 2, 3, 4, 5);
       
        foreach( $numbers as $value ) {
            echo "Value is $value <br />";
        }
       
        /* Second method to create array. */
        $numbers[0] = "one";
        $numbers[1] = "two";
        $numbers[2] = "three";
        $numbers[3] = "four";
        $numbers[4] = "five";
       
        foreach( $numbers as $value ) {
            echo "Value is $value <br />";
        }
      ?>
     
  </body>
</html>

I thought "array_values()" was supposed to be there in the above example but "$value" is there instead.
What is the difference between the 2 ?

https://www.tutorialspoint.com/php/p..._functions.htm
The following seems to be in pdo, which I haven't started learning just yet:
https://www.tutorialspoint.com/php/p...tion_array.htm ]]>
PHP uniqueideaman http://www.webdeveloper.com/forum/showthread.php?363477-How-Come-Variable-Not-Assigned-And-Php-Knows-Where-To-Look-For-Value
HELP! How do I create independent/async processes on the server that work 24/7? http://www.webdeveloper.com/forum/showthread.php?363405-HELP!-How-do-I-create-independent-async-processes-on-the-server-that-work-24-7&goto=newpost Wed, 03 May 2017 00:13:58 GMT Hi folks! I have just recently gotten into the back end side. I want to create a website that does the following but I've been struggling to figure out where to even start the last 2 weeks. I have basic php, javascript and mysql knowledge if that helps.


I want to create a website where:
  • users can create/edit/view processes that echo a text to a log
  • the processes work 24/7 without needing the page to stay loaded
  • real-time logs of processes
  • processes have access to the database
  • processes can be saved and survive restarts and server crashes

Example image: link

My questions:
(Just point me to the right direction that'd be better than nothing)
  • What do I need to learn and use?
  • How do big companies do it?
  • Is there a simpler way for localhost testing?
  • How many methods are there and which are they?


Thank you all! ]]>
PHP ikea4knife http://www.webdeveloper.com/forum/showthread.php?363405-HELP!-How-do-I-create-independent-async-processes-on-the-server-that-work-24-7