Jump to content

nadeemshafi9

Members
  • Posts

    1,245
  • Joined

  • Last visited

Posts posted by nadeemshafi9

  1. Forgot to escape the first double quote before the username variable.

    <?php
    echo "<b><font color=\"$color\"><a href='../profile.php?id=\"$username\"'></b></td>";
    ?>

     

    this works too but i prefer to have definition

     

     

    actualy thats still wrong

     

    <a href='../profile.php?id=\"$username\"'>    WRONG

     

    CORRECT

    <a href=\"../profile.php?id=$username\">

    <a href=\"../profile.php?id=".$username."\">

    <a href=\"../profile.php?id={$username}\">

  2. what happened was i have to apply the subnet mask to the ip's as our networks are usualy subnetted into a few nets and this provisioning tool also acts as a router config generator so theres alot of stuff done with XOR and AND on devimal values of ip's the problem i had is that the php.net fiunction ip2long() returns a -minus value wich is of no real decimal representation then on teh site it says to show the decimal value format it with sprintf using %u i seriously ddont know what that does but fixes it, anyhow i need the minus value that is retunred to convert from decimal back to quad octet ipv4, the php function long2ip() takes the minus value from the previouse function and uses that, there was confusion over this anyways it seemed to be happy with ip's in the 10's range with the unformated values.

     

    My app's look and flow great there super advanced kicking with windows GUIS and magical stuff and a fully zend framwork with controlers im like ajax api/controler/getthisstuffasJSON and then the json is fed into things its sooo powerfull ExtJs and Zend framework.

     

    in controler methods u can just exit with a true false u can use ajax to ask ur server questions very very easily 1 func and 1 call its done, the mod rewrite makes it further powerfull ajax(url:/module/controler/method) thsi is due to the zend framework.

     

    http://extjs.com/deploy/dev/examples/desktop/desktop.html

     

    http://extjs.com/deploy/dev/docs/?class=Ext.Component

    http://php-ext.quimera-solutions.com/

    http://framework.zend.com/manual/en/

     

    its mind blowing, that demo is nothing compared to what u can actualy do

     

    on top of this i am using a ExtJs wrapper so i can do all teh extjs styuff in PHP and then on events write pure Extjs js in a php string in teh event handler of that ExtJS PHP wrapped objjext.

     

     

    MArvel at my glory lol

     

    <?php $templateStore = new PhpExt_Data_JsonStore();
    $templateStore->addField(new PhpExt_Data_FieldConfigObject("template_id"));
    $templateStore->addField(new PhpExt_Data_FieldConfigObject("name"));
    $templateStore->addField(new PhpExt_Data_FieldConfigObject("desc")); 
    $templateStore->setRoot("items");
    $templateStore->setUrl("/api/inventory/filterTemplates");
    $templateStore->attachListener("load", new PhpExt_Listener(
    			                PhpExt_Javascript::functionDef(null,
    			                       "
    			                        Ext.Ajax.request({
    									   url: '/api/inventory/checkiftemplatevalidindbagainstportalandproduct',
    									   success: function(result, request){
    											exists = result.responseText;
    											Ext.getCmp('provisonFormPanel').getForm().findField('p_template_id').setValue($_p_template_id);
    											if(exists == 'true'){
    												myArray = Ext.arrayData.templates;
    					                       		
    												for (i=0; i < myArray.length; ++i){
    					                       			if(myArray[i][0] == {$_p_template_id}){
    					                       				name = myArray[i][1];
    					                       				id = myArray[i][0];
    					                       			}
    												}
    												Ext.getCmp('provisonFormPanel').getForm().findField('p_template_id').setValue(id);
    											}
    											else{
    												if({$_p_template_id} != '0'){
    													myArray = Ext.arrayData.templates;
    						                       		for (i=0; i < myArray.length; ++i){
    						                       			if(myArray[i][0] == {$_p_template_id}){
    						                       				name = myArray[i][1];
    						                       			}
    													}
    													Ext.getCmp('prov_template_id').setValue();
    													Ext.getCmp('prov_template_id').markInvalid('Due to changes in the provisioner validation the template configured (<b>'+name+'</b>) is not allowed in this portal device combo and is not product specific.');
    						                    	}
    					                       	}
    									   },
    									   failure: function(){
    									   },
    									   params: { 
    									   		template_id: '{$_p_template_id}', 
    									   		portal_id: Ext.getCmp('property_id').getValue(),
    											product_id: Ext.getCmp('product').getValue()
    									   }
    									});
    
    			                       ",
    			                       array('c'))
    			                ));
    
    $provTemplateCombo = new PhpExt_Form_ComboBox("prov_template_id","prov_template_id","prov_template_id","prov_template_id");
    $provTemplateCombo->setTemplate('<tpl for="."><div ext:qtip="{desc}" class="x-combo-list-item">{template_id} {name}</div></tpl>')
                     ->setStore($templateStore) // $templateStore 
                     ->setDisplayField("name")
                     ->setValueField("template_id")
                     ->setHiddenName("p_template_id")
                     ->setTypeAhead(true)
                     ->setMode(PhpExt_Form_ComboBox::MODE_REMOTE)
                     ->setTriggerAction(PhpExt_Form_ComboBox::TRIGGER_ACTION_ALL)
                     ->setEmptyText("Select a template...")
                     ->setSelectOnFocus(true)
                     ->setForceSelection(true) // only allow what's inthe pulldown
                     ->setfieldLabel("Provisioned Template")
                     ->setId("prov_template_id")
                      ->attachListener("render", new PhpExt_Listener(
    			                PhpExt_Javascript::functionDef(null,
    			                       "
    			                        if(Ext.getCmp('property_id').getValue()){
    					                    Ext.getCmp('prov_template_id').store.baseParams = {
    											portal_id: Ext.getCmp('property_id').getValue(),
    											product_id: Ext.getCmp('product').getValue()
    										}
    					                }
    					                else {
    					                	Ext.getCmp('prov_template_id').store.baseParams = {
    											product_id: Ext.getCmp('product').getValue()
    										}
    					                }
    			      					Ext.getCmp('prov_template_id').store.reload();
    			                       ",
    			                       array('c'))
    			                )); ?>

     

    in fire fox you attach it to firebug and then trhat lets you programm the @GUI str8 thro a command line in firfox and also you can dump stuff into firefox without having to echo it, you can turn query profiling on to see all your queries in teh firbug console.

     

     

    create a grided output in 2 secs on wich you can double click and a gui window dragable apears with an easy define method of forms etc and its infinate just like windows proepr cloud computing.

     

     

    Thanks guys

  3. if u capture all atempts on your site, you can see there are bots that try to inject a url into your url query variables, these url's have text php code in them, so if you are including files then evaluating them or similar using the url query variables or maby any external source then these bots will inject it and that will probably creat ethe file wich is probably a rootkit setup operation. as they said check the logs and then if you wrote your code for the site wire it up to email you on sql errors and url errors etc and capture all the super arrays especialy GET and POST arrays, email them to urself

  4. all u need to know is a few of the global arrays that contain information about teh client and server and post get variables

     

    and then you can use the functions from php.net to do what you like

     

    you need to learn arrays

     

    single dimensional , multidimentional and associative

  5. session_start(); right at the top of any page u wish to use sessions on absolutly nothing can be outputed before thsi function so at teh top of teh page afte rteh first php tag with no spaces either.

     

    now on that page u can do

     

    //when u authenticate

    $_SESSION['isloggedin'] = 1

     

     

     

    on otherpages start the session

     

    then you can do a if $_SESSION['isloggedin'] == 1 do nothing else header('location: login.php')

  6. defo would liek to the line is smaller less code when using regex

    I checked beforehand and the maximum length for a query is 1 million bytes, so not really a problem.

    The query itself is created by PHP anyway so the typing is minimal :).

    Ended up with this in case you find it interesting

    if( $epInfo['prefix'] != '' )
    {
    $specials = empty( $epInfo['specialTag'] ) ? '' : '%'.implode( "%", $epInfo['specialTag'] ); 
    
    $queryLikes[] = sprintf( 
                   '"%s%%%s%%%s%%" OR filename LIKE "%s%%%s%%"',
    	$tmp = sqlite_escape_string'_', '__', $epInfo['prefix'] ),
    	$epInfo['episode'],
    	'v'.$epInfo['versionPlusOne'].$specials,
    	$tmp,
    	$epInfo['episodePlusOne'].$specials
    );
    }

    And yes.. that's not exactly pretty with the % escaping %.. makes it look very messy.

     

    we should start talking more about regex on this site because on the frameworks its used everywhere, validation etc and other things

  7. also the xampp did not work i try it b4... my mac os x ver. 10.3.7 and it is to my OS problem? if it yes.. god where i look OS here..i have no here.. plsss help

     

    maybe your chip is power pc you need to find power pc compatible versions of xamp servers

  8. I got it working! I installed and setup proftpd and everything works smoothly!

     

    Now to another question...

     

    How do I set to where when a user logins they only see their directory? Instead of the main FTP directory?

     

    im guessing somthing like creat eteh directory and assign it to teh user ???? lol you need to read teh manual

  9. OK now the thing is, I got everything working. Login, redirection a nd logout. BUT now how to make the page inaccessible without login?

     

    I mean is there any way to set it so that only logged in users can see the content and others get redirected to login page?

     

    when you login set a session variable to logged in and on every page check to see if it exists and if its true and when you log out set it to false

  10. I am not 100% sure if this is the write forum or not but here goes...

     

    I have setup my Macbook with a virtual ubuntu distro using VmWare and setup Apache, PHP and the mysql server.

     

    Is there anyway to allow Ftp'ing into this virtual box?

     

    ofcourse if the ip is recognised on teh router then hopefull i recon it will work as normal what have you tried

  11. well i dont know if PEAR has the functionality probably has

     

    http://pear.php.net/package/File_PDF

     

    but the ZEND framework has it zend_pdf

     

     

    $pdf = new Zend_Pdf();

    $pdfString = $pdf->render();

    header('Content-type: application/pdf');

    // Add new page

    $pdf->pages[] = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4);

    // Add new page

    $pdf->pages[] = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);

    $pdfPage = $pdf->pages[1];

    $pdfPage->drawText('Hello world!', 72, 720);

    echo $pdfString;

    exit;

     

     

    usualy people implament this whole directory structure bootstrapped with stuff but you can take teh zend framework library and put it in ur site and just pick classes from it.

     

    http://framework.zend.com

    http://framework.zend.com/manual/en/zend.pdf.html

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.