« first day (819 days earlier)      last day (4143 days later) » 

7:04 PM
@PeeHaa dint get you , @wes got "Parse error: syntax error, unexpected $end in "
 
Instead of storing 10*12 in the db can't you just store 10 in one column and 12 in another one?
 
@PeeHaa im making an app for a general area calculator , so the formula varies :)
 
In that case I would look into parsing the statement (calculation) to get everything you need in the string.
 
Or, store the type of the figure also
 
@wes eval() is never the answer
 
user652649
7:11 PM
@PeeHaa eval('eval();');
 
@PeeHaa sorry ,dint exactly understand what you are trying to say :(
 
user652649
yes it would have been better not answering that xD
 
@user1537158 Let's say you have the following string 10 * 12 + 3. You would have to parse that string to something you can work with.
 
night guy.......-__-
 
You cannot simply let the user insert something and "execute" that. Well you can, but I can also break your website
later @NullPointer
 
7:14 PM
@NullPointer g'night
 
@wes anything that could work ?
 
@NullPointer good night
 
0
Q: How to make a calculator in PHP?

Giulio MuscarelloI want to use PHP to calculate simple algebraic expressions like, 8*(5+1), entered via an <input> tag by a normal user (which means, normal notation: no syntax changes like Multiply(8, Add(5, 1))). Also, it has to show all steps, but that's not hard. The problem, right now, is calculating t...

 
7:34 PM
@PeeHaa Abstract Syntax Trees :)
 
user652649
@NullPointer 1h 30m good night
 
7:55 PM
@Jasper eval
 
@igorw Yeah, I know, I was talking about a correct way to solve the problem (purposely not directed at the OP as it would merely be a confusing term to him
 
hi
say I have a page (index.php) which calls include files (header, footer...) is there a way that I can make only the content of index.php change without reloading the header and footer?
 
user652649
@Charlie not with php only... but isn't a good idea anyway
 
ok
I figured it would have to be javascript
I need the content to change but the navigation bar not to reload
 
@Charlie ajax with php
 
8:03 PM
thats what I am reading now
I have NEVER touched ajax
is this going to be a bitch ass thing to do for a first time with it?
 
@Charlie Could you explain what you want to do, the sentence as written doesn't make a whole lot of sense to me (in other words, I don't think what I read in it is what you meant with it)
 
@Charlie it's just a way to say what you already done in the past
 
ok here is the story
my navigation is a multi level horizontal drop down spanning the whole width of the screen
 
user652649
@Charlie but isn't a good idea because google will not index the pages loaded by ajax
 
example: you want to load a content from within another element. You could use a proxy and inject the result changing the iframe source using javascript
 
8:05 PM
Can I show you the site and then you can tell me my options?
 
from within the called iframe you could have a callback
 
while this is heavy, with jquery and ajax, it's one line
 
@Charlie you can show the site, but it's far more important what you are trying to do and why you are trying to do it
 
If you see the drop downs youll understand more
so if I go down into the 3rd row and click a link, all the sliders close
but I want them to stay open
 
8:07 PM
example: $('#divId').load('page.php');
 
maybe I have to rework the jQuery for that
 
this would load the page.php file into your div
you can even put a callback;
 
But it isnt a good thing to do?
 
$('#divId').load('page.php',function());
 
@Charlie Could you tell me exactly what to click, as I'm not getting what you are describing
 
8:09 PM
@Charlie it depend, i think. I wrote some stuff i am proud of mixing ajax technique, php, jquery and xml.
 
Ah let me upload an update version
one moment please
ok reload
I am going to have the most idiotic SEO guy go through this entire site so I need to make sure that I dont have an crawl problems
ok so On the updated version if you go to about us / contact us
 
and then?
 
Well the page reload makes all the navigation cascade
I need it to stay open
 
it's an anchor link, there is no page reload...
 
@Charlie Google use jquery a lot. I don't think they would have that much contribution if they would've me able to figure it out themself
 
8:14 PM
ok, sorry for my stupidness
I have never worked with this kind of thing before
 
will you use html5?
 
Ha I wish!
 
can you use javascript shiv and modernizr?
 
I have too many languages to learn
I can definitely do that!
If i don't use an anchor link what else can I use?
 
how much content kind will you have to load?
 
8:16 PM
i Cant use a header()?
There will be a fair bit
 
is this the site your are working on? semaphoredesign.com/web-devel/renewal
 
probably 45 full pages
And I wasnt allowed to use a CMS! Damn people!
 
user652649
doesn't load for me semaphoredesign
 
yes
 
8:17 PM
@Charlie The link on Contact us is the same page with a # at the end, which means the browser doesn't load a new page but stays on the same page
 
contact us is contact-us.php
 
put id in your menu so when someone click on your link it can be triggered by your javascript
example: <li><a id="home" href="index.php" >HOME</a></li>
 
ok
and then?
 
if the client support ajax, it will load faster, if not, when he will click on it, we can trigger something
do you use php include for your footer?
 
ok
yes
I have includes for <head> navigation footer contact form and side contact slider
 
8:20 PM
if you wish you can put your javascript code there
now you need to create a function that will capture 'a' id's.
 
@Happyninja Currently you have this in your html <li><a href="#">Contact us</a></li> That means it doesn't load a new page. If you want it to load contact-us.php, it should be <li><a href="contact-us.php">Contact us</a></li> instead
 
so: <li><a id="home" href="index.php" >HOME</a></li>
$('li#home').load('index.php',function());
document ready, a . click
 
@Jasper /contact-us.php that is :)
 
I don't think you need to put it inside a document ready because the php include will always include the latest page.
 
8:23 PM
@Jasper we must be looking at different revisions because contact us is not # it is contact-us.php
 
@PeeHaa Just guessing here, but I think contact-us.php is (at least) in web-devel in which case that wouldn't work
 
$("a#...").on('click', function (e) {
 
what error do you want to capture? it only capture a link
 
@Jasper Didn't see that one :)
 
8:26 PM
I didnt mean (e)
 
@Happyninja That e has nothing to do with errors, right?
 
$('a#').on('click', function(){ //do some kind of redirect });
isn't it considered good practice to use e or err as errors?
 
@Charlie I disagree with @Happyninja that you need ajax here, but since you're already following his instructions exactly, I'll not say anymore as otherwise it will merely be a source of confusion
 
well I am not actually doing
I am writing down and learning
and I would love to learn more possibilities so please
I can't stand blindly following instructions as you dont really learn much...
 
Alright, I'd change your header to make sure the current page in the menu is unfolded
 
8:31 PM
change the header as in the script
?
 
yep
 
because I spent quite some time trying to figure that out and was confused so much in the end I gave up
 
$('a[id^="link_"]').on('click', function(){
		var id = this.id;
		switch(id){
			case 'link_home':
				$('#content').load('handler.php?link='+id.split('_')[1],function(){
					// load callback
				});
			break;
			case 'link_contactUs':
				// etc
			break;
		}
	});
 
There is one thing I hate more than jQuery, unformatted jQuery ;)
@Happyninja edit message and press ctrl+k
 
8:34 PM
if your prefix your id with 'something_' you can take it as a referer
 
@Happyninja the page is finally loading for me (though still very slow) so let me take a look and get back to you with a more concrete suggestion
 
/me passes all the regulars in here a beer (and @Pekka웃 too because he can gets his hands on designer bags)
 
Anonymous
0
A: echo a message while a file is uploading

The COMPLETE PHP NewbieYour code is a real teresko. It is bad, real bad. First thing. The location header(); function should be L (in upper case in Location: ) then, Always use absolute URI's inside a header(); like.. header("Location: http://site.com/somewhere.php?uploaded"); OK? Good! Now, about displaying Load...

 
@PeeHaa Am I regular enough?
 
Evenings
 
Anonymous
 
Anonymous
^ life aint fair
 
@Jasper you passed the 1k message mark. Sure :)
@DaveRandom Jo!
 
@Jasper What? Why are you making a class for multiple protocols? I guess they might share some common code, but just make a base class an extend from it.
 
@PeeHaa In that case, thanks for the beer :D
 
@Happyninja: If i do this using ajax I have to write a case for every page?
 
8:40 PM
@TheCOMPLETEPHPNewbie Header names are case insensitive. sleep() expects an int, not a string, and you can't (shouldn't be able to if your server is set up IMO correctly) echo before header() ;-)
 
Anonymous
About the header, I was told here by some many people that the L should should be uppercase, and url should be absolute, about the sleep, I guess forgot, but i think I deserved the best answer
 
@PeeHaa 'Sup dawg. We anywhere near being able to test updates from your server yet? Sorry for badgering but I'm itching for release now so we can move on to 0.21 :-P
 
@DaveRandom I'm installing my SSL cert now. I'm thinking about hosting it on uploader
lols was just typing
 
@TheCOMPLETEPHPNewbie URL should be absolute, but the name of a header is case insensitive. Anyone who tells you otherwise hasn't read RFC2616.
 
ATM a bit distracted by en enigma machine "how does it work" for newbies
 
8:43 PM
@Charlie no, it depend where do you want to inject the content
 
@DaveRandom I'm making this as part of my framework, so it's not bound to a single use case. The wrapper will be able to work on databases. The idea is that you'll be able to register the same class for different protocols, but on different databases. (Add to that the database system it works on abstracted so far it might actually be working with a different type of persistent storage each time.)
 
ok So I have a div called content, I want to inject content into that div
 
all 54 pages goes in the same div?
 
@PeeHaa kk no worries - but we conceivably could do with being able to execute PHP at some stage down the line, so I'm not sure about the uploader idea - it may not always be a straight static file. Also we need to sit down and really think (ugh) about a future-proof URL scheme for the update path, changing the base update URL down the line could be a real pita...
 
lets say yes for now to make it easier
 
8:45 PM
I can setup cv.pieterhordijk.com :)
 
then I think you would need a way to display your page in case someone go directly to the URL. Example: site.com/contact-us.php
 
has anyone who uses travis-ci gotten ant-contrib to work?
struggling
 
Hi guys
 
What would my file structure be in this scenario? Would I have 54 different php files that ajax handles and inject the content into my page.php div?
 
user652649
@DaveRandom evening
 
8:47 PM
and for SEO purposes how well does this work?
 
perhaps someone can tell me why I getting told by Google Data Highlighter that the pattern does not match the start page? Trying to match a SO clone and create a set of pages that have questions asked
 
@PeeHaa lol enjoy, Lorenz is way more interesting IMO but I've had Enigma rammed down my throat for a while now, Turing is quite highly celebrated amongst nerds in this country these days (and rightly so) and a load of records from Bletchley Park were declassified a few years ago so there's been a million and one documentaries about it recently.
 
@Charlie what about a single xml file?
 
@wes yo
 
yeah that works
my main thing is the seo idiot
he is the reason that I wasnt allowed to use joomla or wordpress!
If i go this way can I allow him to put different meta info for each page?
 
8:49 PM
 
(this guy is a complete ass hole!)
 
Now back to installing my cert
 
@PeeHaa Cool, at the end of the day it's you server/domain so I'm not too fussed, as long as whatever is set up can remain the same thereafter. We no longer require a valid SSL cert because I have implemented all the package signing stuff that lets you do it over HTTP.
(no SSL)
@Jasper Errr... what? What is the stream wrapper going to do then? Do you really need a stream wrapper? Can you expand?
 
Either way is fine for me (its a wildcard cert)
 
Oooooh fancy
 
8:51 PM
:)
 
Might as well go SSL then, when does it expire?
 
@Charlie in a worst case scenario, generate your html with php?
 
Also is it from a trusted root CA
 
Only domain validated though I'm not some rich asshole. :D
 
(one that MS trust)
?
 
8:52 PM
ok
 
@DaveRandom As in their browser?
 
or in my case set a variable with the meta info and then on page change update it?
 
yes
 
@PeeHaa As in the root CA package you get with Windows/from MS update. Chrome uses the same cert stores as IE on Win
 
then you can format a template and insert stuff from a xml file
 
8:53 PM
Which is a little bit :'( in a way
 
user652649
2 hours and 40' of
 
user652649
 
ok
 
@DaveRandom I think MS will think it is valid yeah
 
this sounds like a good plan!
 
8:54 PM
damn putty timeouts!
 
i can paste you some code if you wish
 
in terms of performance, is this going to slow it right down?
 
@DaveRandom The original reason to make it was that the system was compiling templates to php and I wanted to make sure it could run even if there were no permission that let php store the compiled templates. As such, the wrapper would allow to use the database as a place to store the compiled files.
 
maybe your images quality could be a bit lower; 408k!
or preload stuff?
 
ok
 
8:56 PM
like a little intro
so while the intro is playing you can preload your images and scripts
 
for the most part we have no images as layout
 
with a cookie or something to remember when stuff are already loaded
 
I think just logo, social and the 2 big images on the home page
 
@DaveRandom so what is it we still need to release .20? Only my server set up?
 
@DaveRandom However, then I decided I wasn't just going to do that, but instead give the user a class with which he could simply use an abstract file system at will. With the DB Abstraction layer having grown to be extremely abstract, I can very easily use different instances of it to different emulated file systems, which don't even need to use the same persistent storage by only changing the persistent storage object
 
8:58 PM
@Happyninja if you could send me a link to some examples or some actual examples that would be awesome!
I am running really behind on this project and am supposed to have it finished by monday 12:00
 
@Charlie with google chrome you can right-click and audits the page performance
 
@PeeHaa Yep :-) (and to test the update routines of course)
 
got lost in my last snetence there and sort of said the same thing twice, but I think it should be clear nonetheless
 
ah really
 
@DaveRandom Great
Although I have just broken my vps somehow :|
 
8:59 PM
Also my server SUCKS.
 
@wes What a challenge :)
 
@DaveRandom can you go to pieterhordijk.com ?
 

« first day (819 days earlier)      last day (4143 days later) »