PHP FWrite Help

Status
Not open for further replies.

diabolo

Community Advocate
Community Support
Messages
1,682
Reaction score
32
Points
48
Code:
<?php
$filename = 'db.txt';
$omnicon = $name||$url;
$name = $_POST['name'];
$url = $_POST['url'];

 echo "Success, wrote: \n $name \n $url \n to file ($filename)";
 echo "<br />";
 echo "$omnicon";
?>

how is it so that #omnicon can be name||url, since right now when it comes out it doesn't come out like that.
 

kajasweb

New Member
Messages
1,723
Reaction score
0
Points
0
Change the code as
PHP:
<?php
$filename = 'db.txt';
$name = $_POST['name'];
$url = $_POST['url'];
$omnicon = $name||$url;

 echo "Success, wrote: \n $name \n $url \n to file ($filename)";
 echo "<br />";
 echo "$omnicon";
?>
 

diabolo

Community Advocate
Community Support
Messages
1,682
Reaction score
32
Points
48
that doesn't work, it is returning with 1
 

kajasweb

New Member
Messages
1,723
Reaction score
0
Points
0
Oh!.. Do you want to handle these things as Strings and have || in between them? If so, try
PHP:
$omnicon = $name . " || " . $url;
 
Last edited:
Status
Not open for further replies.
Top