php

jquery.form: how to set more than one form in one page?

hi! i have a list of names with "delete" button, every row is a form and clicking on delete the list should be updated in real time but don't works because in this plugin i can set only one id (infact it runs when in the list there's only one name) this is the javascript function: $(document).ready(function() { var options = { ...

Escape the dot in PHP sscanf?

Hi, This doesn't work: list($value) = sscanf('foo.bar','%s.bar'); echo $value; //foo.bar While this does: list($value) = sscanf('foo bar','%s bar'); echo $value; //foo Any suggestions are really appreciated. Thanks. ...

PHP code safeguard technique for Remote call, scenario based

hi, I am thinking about safeguardimg my php code in a different way for my project, but it may be childish method. Please let me know alternative or pros and cons of this method. Both client and server has LAMP. Client system holds client sensitive data, which will not be shared to the server. Client will have Auth key to access serve...

Are there any PHP Hosts (shared) which do not block port 2195 and 2196 outgoing for iPhone Apple Push Notifications (APNS) ?

I have my iPhone Apple push notifications (APNS) working in php on my own machine. I do not block port 2195 outgoing, but it seems HostGator does and is reluctant to open up the port. I'd imagine many web hosts are the same, but I'm wondering if anyone's found one that does not block 2195 and 2196. I realize I could use a VPS to do th...

Navigating objects and arrays

Can you please show me an example in php on how to grab specific information in a loop of some kind, I want to access [language] and [answer] => [question] => everytime it is there. Thanks Array ( [0] => stdClass Object ( [type] => text [cue] => stdClass Object ( ...

Three problems in uploading a file into database and then how to download it back

<?php $con=mysql_connect("localhost","root",""); if(!$con) { die('Could Not Connect:'.mysql_error()); } mysql_select_db("tcs",$con); $upload_to = "./uploadedfiles/"; move_uploaded_file( $_FILES["filename"]["tmp_name"], $upload_to . "/" . $_FILES["file"]["name"] ); ...

paging with php?

hello i want to list contents as 10 contents per page this is source code for each content <? while ($arama=mysql_fetch_array($arama_sonuc)) { ?> <h4><a href="oku.php?id=<?=$arama[id]?>"><?=$arama[baslik]?></a></h4> <div class="article box"> <div class="article-desc-oku"> ...

how to check a file path is an image or not in php?

Hi guys, I have a table that stores file paths of images.documents,pdf etc... My query is Select File_Paths from Uploads Now how do I check whether the file path is image or not using PHP... If it is an image i have to view it or else download it....... ...

how to download update zip package and install it

hey guys i know how to write a update script for my project , the easiest way is to write a file and give it to the user and ask him to go for it . but i want to update his website automatically . exactly like wordpress as u can see user can click on a button and the script will do next steps. problem is how to Downloading a zip file...

automatically grab php extension in xampp

i m using xampp any project that is saved in htdocs is open in http://localhost/projectname/filename.php i want that is there any way to do so when i type http://localhost/projectname/filename and open that page means no need to write .php extension in file( by default extension should be php) ...

whether this php syntax is correct?

hai guys, As i am a newbie i want to check a file path is an image or not <? if(strpos($row['dfilepath'],'jpg') != false) { <img src=" <?= base_url().'/uploads/'.$row['dFilePath']?>" /> } else { <input type="button" onclick="loaddetails('<?php echo $row['dFilePath'];?>');" value="<?php echo $row['dFile...

Adding amount to background-position on click (jQuery)

Hey, I pretty new to js and jquery so please bear with me. I'd like to change the background-position and add 1% on #div1 while clicking on #button1 and take -1% on #div1 while clicking on #button2 How could i achive this in jQuery? Alse, bonus question: These are going to get dynamically generated through php. Is it possible to use ...

PHP - Worth including the data type in the variable name?

Hello! I'm trying to write my code as maintainable and easy to understand as possible, and I thought of including the type of data a variable holds in its name. e.g: $intCurrentLine = 1; instead of $currentLine = 1; $strUser = 'blah'; instead of $user = 'blah'; I don't think it is really necessary in the above example, but may it be...

Page break in Html2Pdf

Hello everybody, I am in the process of generating a dynamic pdf file, which contains data of around 10,000 users, in general the app is developed using mySql and PHP. The dynamic content is so heavy that, I found it difficult to process with fpdf() class. So I converted my output php page as a html file using ob_get_clean(). Now...

How to test if a directory already exist in PHP?

How can i test if a directory already exist and if not create one in PHP? ...

PHP drop down and Session question

What really needs to happen here is.. A session takes my data from the drop down listed below. Its gonna take it to the process page then bring it back to this page with a header on the process page. Then when it gets back to the first page the dropdown will populate with the session or the same client as when I left that page and the on...

Echo can you hear me?

Why is showphp_Smartfm() Not echoing at all. foreach($response->quizzes as $quiz) { echo $quiz->question; // not echoing echo $quiz->answer; // not echoing } Followup Question to http://stackoverflow.com/questions/2116963/navigating-objects-and-arrays http://github.com/klanestro/Vortoj <html> <b...

PHP: Define function with variable parameter count?

Is there a way to define a function in PHP that lets you define a variable amount of parameters? in the language I am more familiar with it is like so: function myFunction(...rest){ /* rest == array of params */ return rest.length; } myFunction("foo","bar"); // returns 2; Thanks! ...

Preventing jQuery from Loading

If jquery is added in globally used header.php across the site then How to stop to load jquery library only for those pages of site which doesn't need actually? If we can't use more than one header. purpose of question is to not to penalize those page with slow loading which actually don't need. ...

stripping out all characters from a string, leaving numbers

Hay, i have a string like this: v8gn5.8gnr4nggb58gng.g95h58g.n48fn49t.t8t8t57 I want to strip out all the characters leaving just numbers (and .s) Any ideas how to do this? Is there a function prebuilt? thanks ...