« first day (480 days earlier)      last day (4486 days later) » 

12:11 AM
I just broke production.
Fortunately, it wasn't my fault.
 
head explodes
 
Someone made changes to the files on production outside of version control and didn't check them in. Wish I knew who did it.
Yeah, when production is a live website, it's really bad when it all comes down and everyone at work is going: WHO DUNNIT!
 
I am one of two developers with my company, so pointing the blame is usually pretty easy.
 
lol
I didn't do it, that leaves . . .
Easy puzzle.
 
Levi, do you know much about symlinks?
 
12:14 AM
I'm not sure about 'much' but I've used them plenty.
Very useful.
 
Indeed.
I'm trying to symlink a folder, but dreamweaver is seeing it as a file.
 
Ah, you have the 'privilege' of working with Dreamweaver.
 
But it works fine in muh browser dev.rayhawkpas.com/awd
 
What OS's are involved?
 
Cent
 
12:16 AM
And a Windows machine running Dreamweaver?
 
yes
 
PFY
steve, is this via samba?
 
I think it's a server configuration problem. I have had several other linked folders work fine, but lately they're not performing as expected
samba?
Doesn't work in filezilla either
it shows the folder, but can't open
 
Does Windows Explorer see them correctly?
 
PFY
Samba is the windows compatible file/folder sharing service on linux
It sounds like it is misconfigured, it should be follow symlinks = yes
wide links = yes
"follow symlinks = yes
wide links = yes"
 
12:18 AM
@PFY Where would that be set
 
I checked my httpd.conf and followsymlinks is in there
 
PFY
that link has details on file locations and a warning about security when doing this
 
and my htaccess
 
@PFY It's working for him on CentOS, just not in Windows.
@stevether Does Windows Explorer view the file as a directory, or is it a Dreamweaver specific issue?
 
12:20 AM
Checking WE now
It appears as a extentionless file shortcut
 
PFY
@Levi that's what makes me think that it is a samba issue and not an apache issue
 
adding those two lines to smb.conf...
didn't help
 
PFY
humm
 
It was working before is the thing
 
PFY
and you restarted samba?
 
12:26 AM
And to my knowledge nothing changed
 
I normally don't ask for upvotes, but:
0
A: Why isn't this a integer considered a php is_int?

Levi MorrisonFor the love of all that is good and sane, don't use is_int nor is_numeric for this! Use filter_var: filter_var($_GET['page_number'], FILTER_VALIDATE_INT); The filter functions support a much broader range of validation techniques. There isn't anything wrong with is_numeric, but you specificaly...

 
tried samba: unrecognized service
 
Please save the OP from the is_numeric ignorance.
 
PFY
should be /etc/init.d/smb restart
 
btdubs, trying to open the symlink gives me 12003, didn't see much help on google
@PFY restarted, still not working
*started
wasn't running to begin with
 
12:30 AM
Actually, ignore my requests for upvotes.
 
PFY
oic
Have you tried making a hard link instead of a sym link?
 
@LeviMorrison now it's official
@PFY negative
ln: ../../myrayhawk/awdfiles': hard link not allowed for directory`
 
directories cannot be hard links
 
 -d, -F, --directory         allow the superuser to attempt to hard link
                                directories (note: will probably fail due to
                                system restrictions, even for the superuser)
 
12:36 AM
hi
 
PFY
ahh, now I feel dumb
is the FollowSymlinks option set in your htaccess?
 
can't i use safe urls in form's action?
 
@PFY and virtual host file and httpd.conf
 
So, is there something wonky about the way that constants and requires interact?
 
@Malixxl What do you mean, 'safe urls'?
 
12:39 AM
<form action="memberpage2" method="POST">
 
PFY
sorry man, I'm outta ideas
 
:C
 
ReWriteRule ^memberpage2 memberpage2.php and this is my url rewrite rulke
 
    DocumentRoot "/home/rayhawkpas/public_html"
    <Directory "/home/rayhawkpas/public_html">
        Options +Indexes +FollowSymLinks
        Order allow,deny
        Allow from all
        AllowOverride All
    </Directory>
 
but when i post my form, it redirects me back go memberpage1
to*
 
12:40 AM
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
 
@Malixxl Can you give the full URL?
 
Options +FollowSymLinks
RewriteEngine on
 
I promise to not be malicious.
 
full url mean?
its on localhpst 127.0.0.1/site/member.php
and member2.php
i rewrite em like member and member-2
member page posts a form to member-2
without url rewrite it works good
like when i connect to member.php it works
but when i connect to member and change form action from member2.php to member-2
 
12:43 AM
it doesnt work
 
O nvm same as @LeviMorrison :P
 
@stevether If the symlink can be followed via apache and the centos box then it's fine and is probably samba related...
 
Ok, so:

My pages all route into the PHP backend with "require_once("includes/inc_structural.php");"

The first line of inc_structural is:
define('HOME', "/blahblah/");

It then has some more require() lines and some classes.

I should be able to reference HOME anywhere in those required files, yes?
 
@dsas Samba is the ftp software?
 
and here is my full url rewrite rules, i think something wrong here
RewriteEngine on
ReWriteRule ^index$ index.php [L,NC]
ReWriteRule ^member member.php
ReWriteRule ^member-2 member2.php
 
12:46 AM
Shouldn't the last two be switched?
 
@dsas this is a godaddy VPS, i think it's using vsftpd
samba isn't running
 
@stevether ah, sorry. Have you tried using a different ftp program? I've had problems with filezilla and symlinks years ago.
 
dreamweaver, filezilla, and windows explorer all have the problem
 
@levi i found where is my mistake
when i put $ end of rewritten url its ok
 
@stevether vsftpd will stop you from following a symlink that is outside of the ftp home directory that it chroots you into. Are you sure the symlink doesn't go to a different directory?
e.g. if you're in ~stevether/, ftp sends you to ~stevethere/www and your symlink is from ~stevethere/www/foo to ~/stevether/bar
 
12:51 AM
@LeviMorrison ty for attention anyways, cya.
 
hmm
when I log in, i start at /home/user1 my symlink is ln -s ../user2/somefolder dev/somefolder
 
yeah that's probably not going to work, it's a security measure, you'll only be able to access things in /home/user1
 
But if that's the problem then I'm confused, because ln -s ../user2/somefolder/specifcfile.text dev/somefolder/file.text will work
just not the dir
 
oh, I'm surprised that works...
 
and going to site.com/linkedfolder works too
 
1:02 AM
going to site.com/linkedfolder will work, it's the ftp daemon that (supposedly) prevents this.
 
ah
lemme see if I can symlink any folders...
okay that works
so it probably is that block.
 
heh, the work around is to use a bind-mount, I'm not sure if your hosting allows that.
 
bind-mount?
 
(or to switch connections between user1 and user2 when ftping)
mount --bind olddir newdir
It basically lets you make a directory available in two places at once...
might want to double check I remembered the syntax before using it
 
nope, shoot first, aim later
\o/
what happens when I delete the mounted folder? it won't delete the original will it? or do I unmount or something?
 
1:14 AM
I think it does... yes unmount it.
 
how to unmount
unmount didn't work
 
it's umount
 
device busy...
 
Just to check, you should umount newdir.
 
yes
 
1:18 AM
If it's still busy then ensure you're not using that directory anywhere.
If you're positive it's safe to unmount then you can force it
umount -f to force, or umount -l to unmount it partially now and fully once it's no longer busy
 
grr, it worked the first time now it isn't
 
what isn't working?
 
der mount
 
any error messages?
 
nope, looks like it worked but the dir is empty
 
1:27 AM
If you run the mount command and then immediately use $? it will print the return code of the last command. Might be useful.
the original directory does still exist doesn't it?
 
i think i just deleted everything in the dir on accident
it does, was empty
hey thanks man, i think you solved my problem
 
ok, happy to help.
I hope you have backups :)
 
1:41 AM
2002?
there has not been a boo update for 10 years?
 
 
4 hours later…
5:52 AM
india asking pattern ?
that author seems to have an irrational fear of question marks
i am starting to suspect, that hindu written language lacks punctuation
 
 
2 hours later…
7:44 AM
What is the purpose of using these tags: <meta name="viewport" content="width=device-width" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=yes" />
In order to have the h1 tag etc display like it does on a pc?
I tried reading, but I did not understand
 
8:09 AM
this is apparently not PHP, as PHP know no tags.
 
Is there any code that merges phpunit coverage html reports along with svn blame?
 
@Pjotr , they are for handheld devices
 
hiii
any one is here who know joomla i need help...
 
8:38 AM
 
hey thnx but now want help in joomla, not want to learn english now
 
stupid chat. I choose 'valid' for the flagged message and it says you flagged it. and no way to revert
 
@ColShrapnel , you can always write a little rant on Meta
 
these NET programmers are such NET programmers
Actually I can't. I am banned and also deleted my account there
 
8:57 AM
how add new view at adminside in joomla...??
hello
 
9:57 AM
hello
how can I write something like this: if($var == $var1 || $var2) ?
 
did you try ?
 
of course
is that right?
 
it t is meant "if var is equal to eother var or var 2" I believe
so, you can't.
either*
one you wrote is actually if($var == $var1 OR $var2 == TRUE)
but you want probably if($var == $var1 OR $var == $var2)
but my mind-reader may fail me of course
 
i see. thanks
i think you re right. I searched a bit and saw the same thing. I was just wondering if it was possible
 
10:21 AM
thanks guys see you soon!
 
damn .. Sublime Text configuration is confusing
 
Hiho
 
11:01 AM
hey guys, is it possbile to draw the easy way, apc data with php?
are there any functions for this?
i mean using the php gd extension
other question, what SO site to use or does it exist if I want some Linux related question?
not programming though
 
hi
any1?
 
11:20 AM
@Vlad imagecreatefromstring() the only possible function I can imagine relevant to your question, though I've got only several technology names.
 
11:33 AM
hiii
How to work with multiple views in Joomla 1.6
 
Hello. I normally program for ios, but with my current project need php to transfer data to a mysql database. I ran into the following problem: When transferring something that has blanks, the database won't accept it. Can someone tell me or refer me to a doc or something on how to avoid this problem? I was thinking of inserting "$" or "%20" - Thing is: I dont know how to do it programmatically or if I can do it via php.
 
11:53 AM
there is no such problem. mysql accepts spaces as well as any other characters
 
Oh. Then I am mistaken. Thanks for the clarification
Thing is, I add numbers. And he accpets them as long as they dont have spaces between them, e.g. "111 222". "111222" is fine
 
111 222 is not a number. it is 2 numbers actually, separated with space.
 
Well, yeah, right. So is there a way, if the user enters more than one number to still save them in one cell in the database?
Like I said, I was thinking in filling these spaces with something like "$" or "%20"
 
if that field is a from type "long", you can't
actually for a database it would make sense to make two entries (I assume you have another field that stores the user id or username)
 
yes I do
To clarify: Im saving the users contacts in the database.
 
12:04 PM
and in general, if you add a space to a number, it's not a number anymore, it is a string (varchar, etc.)
 
Yeah I'm saving it as a varchar. Type is fulltext btw
 
to designate a string data you have to enclose it in quotes and escape special characters in it
in the SQL
otherwise it will interfere with the program language.
Say, in PHP you cant do something like $int = 111 222;
 
Yes, I'm actually doing it like this in order to retrieve it: if (isset ($_GET["number"]))
$number = $_GET["number"];
else
$number = "1";
 
And what exactly is your problem? What code causes what error? Currently we are just guessing what your problem might be :-)
 
Oh sorry, I thought I made it clear :(
 
12:09 PM
to designate a string data you have to enclose it in quotes and escape special characters in it.
 
I dont get an error message or something. But as soon as I try to add a contact which number without spaces he just won't add the said contact in the database.
 
mysql_real_escape_string() have to be used to escape. single quotes have to be used to quote
 
@ColShrapnel I'm sorry, I thought this is what I'm doing? (Then again english is not my native tongue, so maybe I misunderstand you)
 
mysql_error() have to be used to report errors :)
 
what he says - and if that still doesn't work, show us the code or link to a question on SO with your code :-)
 
12:11 PM
English is not my native either, but to me yours is perfect. However I can't see from your code that you are adding quotes aroud your string
$number = mysql_real_escape_string($_GET["number"]);
$sql = "INSERT INTO table VALUES('$number')"
mysql_query($sql) or trigger_error(mysql_error().$sql);
 
You could just use prepared statements as well. Original mysql_ extension is being deprecated.
 
Oh my, thank you very much, it is appreciated :)
@ColShrapnel very appreciated
@CharlesSprayberry thanks for the link
 
note the quotes around $number. try to echo $sql to see the result.
 
Okay, thanks, I will do that right now and get back to you
mmh it says: Parse error: syntax error, unexpected T_STRING in /data/multiserv/xxx/phpFile.php on line 20
here mysql_query($sql) or trigger_error(mysql_error().$sql);
here is my full code (without username, password of course)
if (isset ($_GET["name"]))
$name = $_GET["name"];
else
$name = "JulianN";

if (isset ($_GET["lastname"]))
$lastname = $_GET["lastname"];
else
$lastname = "NachnameN";

$number = mysql_real_escape_string($_GET["number"]);
$sql = "INSERT INTO table VALUES('$number')"
mysql_query($sql) or trigger_error(mysql_error().$sql);


$con = mysql_connect($DB_HostName,$DB_User,$DB_Pass) or die(mysql_error());
mysql_select_db($DB_Name,$con) or die(mysql_error());

$sql = "insert into $DB_Table (Vorname,Nachname,Nummer) values('$name','$lastname','$number');";
 
what about not just copy-pasteing the code but taking an idea from it?
 
12:26 PM
Hi@ColShrapnel
 
what is line 20...
 
@andreas
 
Well... I edited it slightly after getting the error message. But like I said as of now I'm really not that familiar with php (just started yesterday for my new project)
 
there is a semicolon forgetten at the end of $sql=... string. But you don't have to put this string in your code. It is supposed to be an example
 
line 20 mysql_query($sql) or trigger_error(mysql_error().$sql);
 
12:27 PM
yeah, forgotten ;
 
Yes, I fixed the semicolon one
 
lol
 
@all... Could anyone please let me know an IDE tool for php?
 
here I edited this line to: $number = mysql_real_escape_string($_GET["number"]);
$sql = "INSERT INTO $DB_Table VALUES('$number')";
mysql_query($sql) or trigger_error(mysql_error().$sql);
 
do you notice quite similar line in your code? You are supposed not to paste my line but alter yours
@maya NetBeans
 
12:30 PM
@ColShrapnel Thanks
 
@ColShrapnel Okay, thanks then, I will look at your code and try to work with it :)
 
@Blade don't forget to treat name and lastname the similar way
 
okay
 
this was a general example of how to deal with strings and how to run your queries making them tell you errors
 
why , oh why you are still using the mysql_query() , @Blade ?!?
 
12:34 PM
well, maybe because im a total beginner in php? :)
 
how does that excuse use of deprecated functions ?
 
a legacy
 
@tereško mmh I didnt think it would be deprecated. Didnt get any error message or whatever. In the docs I read it always sad that mysql_db_query would be deprecated and to use mysql_query
 
thanks
 
12:43 PM
wtf mysql_query deprecated? ...
 
@andreas , you should have been using mysqli or pdo for ages
if you have not , then you are just a noob who plays in "developers"
 
it's not deprecated at all, it's just recommended to use mysqli. that's a difference
 
@andreas because it's orphan. Nobody wants to care of old mysql ext. That's all. No maintainers.
it is not deprecated yet but if noone pick it up, it will be.
 
that's true, but it will take some time until then...
 
12:54 PM
yep, but it's time to slowly move to mysqli and yet a reason for noobs who plays in "developers" to boast they already using mysqli
:)
 
I don't know who you refering to but I never said I would use mysqli ;)
 
@ColShrapnel How can it be that as soon as I try to add a contact with number that has spaces the php file is not even considering it? I dont get an error or anything else. He just doesnt use it.
 
@Blade may be you used my code wrong way
 
that might be
 
@andreas anyway. whole matter is not a big deal as one have to use some sort of abstraction library, not raw API calls in theyr code. if they do, the whole ext mess doesn't make too much a trouble - it is a matter of a few hours to rewrite your library for the other ext. If they don't - they are in the deep trouble already, no matter what ext they are using
 
1:03 PM
what did you mean by that ?
sounded like "you should use ORM"
 
@ColShrapnel Thanks again for the help. Also thanks to everyone else who helped :) I see if I can get to work. cya
 
ORM is a different thing, makes SQL completely hidden from you.
But I am talking about some intelligent approach of using raw SQL, without hundreds of repetitions of mysql(i)_query, mysql(i)_fetch_array, mysql(i)_real_escape_string, prepare, execute and such.
 
Thx dude for the input. I will look into it with joy. But still better be a noob here than somewhere else. I really feel sorry for some people - better be a php noob than a real life noob. ;) Peace, I got a train to catch!
 
not to mention some important things like error handling, query logging and such.
 
afternoon
0
Q: msql query returns nulls

Frank AstinI've got a php script which queries mysql for a certain row based on it's id . This works fine for the first 3 , but on the 4th it returns nulls on all fields. here's the querie : mysql_query("SELECT ind,title,body,img,tags,live FROM project WHERE ind = '".$curid."' ") let me know if you ne...

 
1:25 PM
@FrankAstin there are null values in the table
 
@ColShrapnel nope
 
sure they are.
 
I've got phpmyadmin open and they're all populated
 
if things really are as you described them
if query returns any values, and these values are nulls, they are certainly nulls in the database.
if it's other code makes them nulls, or query just doesn't return anything, you cannot say that query returns something
you can query wrong database too. it happens sometimes.
do you have any idea of debugging?
 
ah , it was JSON giving the nulls , echoing directly gives nothing
yep my fault , got the id's mixed up
 
1:40 PM
is there any api for language translater
???
 
hey guys
 
Version 2 paid now
:(
 
serializing object means converting it into JSON object?
 
nope
not in php
 
1:45 PM
any help with utf-8 chars from Excel to Arabic ?
I want to import data from Excel file to save in my database with utf-8 chars
 
however, json itself is sort of serialization. but PHP already has historical serialize() makes the term ambiguous
 
serializing means convert to string., but what type of string, is there any structure? Is it alike JSON
 
yes. it is alike json
 
why ambiguous?
so serialize(object) gives JSON but it is a string like "string"
 
serialize(object) does not produce JSON
that's the point
json_encode produces json
 
1:53 PM
@frank is there any other 3rd party language translater
 
@hardik god knows , try babblefish??
@hardik I imagine google would be the best , what features does it lack for you?
 
yup i know that
google is the alwayz best
but manager
 
Hi Everybody, i'm searching a way to retreive some element from a distant HTML page with PHP, did someone could point me a function or a technique please ? i've tryed with DOMXpath but can't figure out how it work ?!
 
@JonathanLaf what kind of object?
 
I'm trying to retreive a random image from my flickr account, ( flickr.com/photos/75225458@N08 )
http://pastebin.com/Bb4DVSmj

That's what I have at the moment
but it's not working
@FrankAstin
@FrankAstin still alive ?
 
2:15 PM
@JonathanLaf Have you had a look at flickrs api ?
 
I wouldnt pass by the api, just retreive information from the page (could be reused on other service after)
 
2:28 PM
Is it bad to change contents of an array while iterating through it? Like: foreach($array as &$value) //do something to value
 
@UmairAhmad it depends a lot on the situation
it can be bad, but it can also be bad not to do it
for example if you deal with large data matrices
because passing the array by reference will use much less memory if it's a lot of data
you have to show the context of the usage, otherwise it's impossible to say if it's good or bad
 
Well I was using this method once and popping values off the array and after the loop I printed out the contents and I had some garbage values at the end of the array. So I thought maybe using a reference led to unpredictable results. I don't remember exactly what the code was but I'll try to replicate it
 
basically you are breaking encapsulation on the array level, if you pass by reference
so you have to know what data you are dealing with
if you're looping over an array, maybe even loop over subarrays, etc. you can end up with a very high memory usage, if you pass a copy of the array instead of a reference
but you can only pass by reference, if the original data is of no importance
meaning that there is only one instance of that matrix
then it's like static data
similar to using the static keyword for methods
 
2:45 PM
@markus looks like gh-pages require index.html files
@markus but you can reference the schema from the gh-pages link as well.
@markus the following should work then:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://gooh.github.com/phpunit-schema/3.7/phpunit.xsd"
 
@Gordon ah ok, so you mean even though it's not directly browsable, it works as schema location
yeah, cool... I don't know if I would rather include it locally though
 
@markus yes, i understood this to be the request of the ticket
can do locally as well
 
yep, but it wasn't my ticket, I just noted that the raw version IS actually browsable
 
it will eventually be included with phpunit. will send a pull request today
 
which was probably an unnecessary comment, if the raw vesion is not what is needed for the location link
oh, cool! even better
 
2:51 PM
quick, delete it. delete it! :D
 
@Gordon :) deleted, to save my reputation
 
@markus ;)
 
Is PHPIDS worthwhile to use?
 

« first day (480 days earlier)      last day (4486 days later) »