Jump to content

Ramin2097

New Members
  • Posts

    8
  • Joined

  • Last visited

Ramin2097's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi.I found out that PHP developers can make apps for android too with zend which I'm really interested in.Does anyone have any resource or tutorial teaching how to do that?for now the apps I'm going to develop are just going to contain Text.not advanced apps do crazy things. BTW I'm new to php and trying to learn fudamentals etc.If I want to go into app development wouldn't it confuse me?can I do that?thanks and sorry for my english
  2. Anytime Buddy. I guess they already did.the link belongs to 2012!it means by now it should be done... and in the link is a video that someone makes an app with the zend editor!but of course he was expert and I'm not.I didn't find out any resource or tutorial.I hope I can find some here. I started new topic at this link: http://forums.phpfreaks.com/topic/290624-android-php-based-applications/ 14 people viewed no answer yet...
  3. First of all thanks for your reply.I know that but: http://venturebeat.com/2012/10/23/huge-news-php-developers-can-now-design-build-and-publish-mobile-apps-right-in-zend-studio/ according to this link we can write android apps with php...just don't know how to
  4. OOPS!LOL.strange.It didn't work when I posted this now it does! Thank U very much for your help.I really appreciate that. Just one more question.I posted the topic but no answer till now. Can I really develop android apps with php?and if yes how?I googled that and the answer was yes but didn't find resources about how to do it.
  5. all right.I updated my code.Still doesn't work!sorry I probably have made a stupid mistake or forgot something but can't understand what!:| <?php function random_bytes($number_of_bytes) { if (!$number_of_bytes) { trigger_error('Invalid number of bytes.', E_USER_WARNING); return false; } $random_bytes = null; if (function_exists('mcrypt_create_iv')) { $random_bytes = mcrypt_create_iv($number_of_bytes, MCRYPT_DEV_URANDOM); } elseif (function_exists('openssl_random_pseudo_bytes')) { $random_bytes = openssl_random_pseudo_bytes($number_of_bytes); } else { $random_bytes = @file_get_contents('/dev/urandom', false, null, 0, $number_of_bytes); } if ($random_bytes) { return $random_bytes; } else { trigger_error('Failed to generate random bytes.', E_USER_WARNING); return false; } } function random_hex_bytes($number_of_bytes) { return bin2hex(random_bytes($number_of_bytes)); } function upload($file,$dest){ $a=explode('.', $file['name']); $filename=$a[0]; $ext=$a[1]; $add=microtime(); if (file_exists($file['name'])) { random_hex_bytes(16); } if(move_uploaded_file($file['tmp_name'],$dest.random_hex_bytes(16))){ echo 'File Uploaded'; } print_r($file['name']); } echo random_hex_bytes(16); ?> <html> <head> <title>File Upload</title> </head> <body> <?php if($_FILES['picture']['name']){ upload($_FILES['picture'],'upload/'); } ?> <form action="" method="post" enctype="multipart/form-data"> <table width="500" align="center"> <tr> <td><input type="file" name="picture"></td> </tr> <tr> <td><input type="submit" value="Upload" name="submit"></td> </tr> <tr> <td><input type="hidden" name="form" value="1"></td> </tr> </table> </form> </body> </html>
  6. All right.U see my code at first post. 1-Should I delete the php part I've written my self and replace yours or simply add it under my first function? 2-and is dev/urandom the output folder?if it is and I want to change it to images file for example I should just change the '/dev/urandom' to '/images'?no other changes in codes? I'm trying to figure out what U did exactly.but kinda confused.I'm checking every function in your code to understand.but still a bit confusing.U have any resources or tutorials teaching your code step by step?as you mentioned you can't repeat everything so I'm asking for a tutorial or resource.and again thank you very much BTW maybe it's not the right place to ask this but don know where else to... I'm also interested in app development for android and I discovered that it can be done with php too.so if I learn php can I do that?how much knowledge on php do I need?would it confuse me or on the contrary help learn and understand php better?
  7. LOL.buddy I'm new and it's just start for me!I'm doing it step by step and the first step is to prevent overwriting.If I do them all at the same time(for start cuz it's the first time I'm making a form)I will get confused so I want to do it step by step then make a complete form.So...I didn't get anything from your code/:D Can U say it a bit more newbie friendly? And Thank U very much buddy.
  8. Hi every body.I'm new to php and this site.this code I've written is for uploading file and I want it to don't overwrite files with the same name.I thought I told it to with file exists.but doesn't work.can't figure out where the problem is.Sorry for my English and Thanks! <?php function upload($file,$dest){ $a=explode('.', $file['name']); $filename=$a[0]; $ext=$a[1]; $add=microtime(); if (file_exists($file['name'])) { $filename=$add.$filename.$ext; } if(move_uploaded_file($file['tmp_name'],$dest.$file['name'])){ echo 'File Uploaded'; } print_r($file['name']); } /* Array ( [picture] => Array ( [name] => Chrysanthemum.jpg [type] => image/jpeg [tmp_name] => C:\Users\NOVINP~1\AppData\Local\Temp\php\upload\phpFA89.tmp [error] => 0 => 879394 ) */ ?> <html> <head> <title>File Upload</title> </head> <body> <?php if($_FILES['picture']['name']){ upload($_FILES['picture'],'upload/'); } ?> <form action="" method="post" enctype="multipart/form-data"> <table width="500" align="center"> <tr> <td><input type="file" name="picture"></td> </tr> <tr> <td><input type="submit" value="Upload" name="submit"></td> </tr> <tr> <td><input type="hidden" name="form" value="1"></td> </tr> </table> </form> </body> </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.