ignace
Moderators-
Posts
6,457 -
Joined
-
Last visited
-
Days Won
26
Everything posted by ignace
-
// multiple uploads are added in a numerical array as explained in the php manual // $_FILES = array // ( // 'tmp_name' => array('msdj.tmp', 'msjsd.tmp', ...), // 'name' => array('filename1', 'filename2', ...), // 'size' => array('sizeFile1', 'sizeFile2', ..), // ... // ); // // number of uploads $num_uploads = sizeof((array) $_FILES['tmp_name']); if (1 < $num_uploads) { // multiple uploads for ($i = 0; $i < $num_uploads; $i++) { if ($_FILES['error'][$i] == UPLOAD_ERR_OK) { // this upload is ok } } }// Else single upload
-
Help me understand why one item takes precedence over the other.
ignace replied to Darkmatter5's topic in PHP Coding Help
<?php // create an .htaccess file that reads the line: // php_flag register_globals off if(!isset($_POST['load']) && !isset($_GET['job_id'])) { $byrndb->job_list(2,$job); // NOTICE: $job is undefined here } elseif(isset($_POST['load'])) { $job=$_POST['job']; $byrndb->job_list(2,$job); } elseif(isset($_GET['job_id'])) { $job=$_GET['job_id']; $byrndb->job_list(2,$job); } ?> -
stop writing SQL at all and use Object Relational Mapping (ORM) like Propel or the Zend_Db component from the Zend Framework
-
<form action="googleit.php" method="post" .. <input type="text" name="keyword" ... googleit.php // assuming $_GET was filtered and validated $keyword = $_GET['keyword']; // write to db ... // refer to google search header("Location: http://www.google.com/search?q=" . $keyword);
-
this entirely depends on your database normalization, i would use an intersection (many-to-many) table to store the ids of what the user has choosen, so for your example i would have the following fields: country_id task_id timeofday_id where task and timeofday would come in a listbox and country in a combobox because we can only perform one task during a certain point in the day, but we could do this in different countries (theoretically anyway) although i think that this was not a good example
-
yep you are however bound to the Component Object Model (COM) to build excel files http://be.php.net/manual/en/book.com.php
-
[SOLVED] insert one variable from array in dBase
ignace replied to web_master's topic in PHP Coding Help
<?php if (isset($_POST['news_type'][1])) { // update for news_type[1] } elseif (isset($_POST['news_type'][2])) { // update for news_type[2] } else if (isset($_POST['news_type'][3])) { // update for news_type[3] } -
Help Needed=parse error unexpected T_LNUMBER on Line 31...
ignace replied to phphp's topic in PHP Coding Help
$mainkeyword ="Entrepreneurship,Entrepreneurship Success Guide"; -
UPLOADING FILE (IMAGE) TO SERVER - BUT RENAMING THE IMAGE NAME...
ignace replied to nightkarnation's topic in PHP Coding Help
<?php $target = "images/"; list($filename, $extension) = explode('.', basename($_FILES['photo']['name'])); $filename = sha1($filename); $target = $target . $filename . $extension; -
$features = mysql_fetch_assoc($result); should give you someting like: array( 0 => array( 'rowfield' => 'rowvalue' ) ); another option is the Iterator class as found in the PHP Standard PHP Library (SPL): http://www.php.net/~helly/php/ext/spl/ or: http://be.php.net/spl
-
eval(): http://be.php.net/manual/en/function.eval.php
-
on the top you write: $start = microtime(true); and at the bottom you write: $msecs = $start - microtime(true); print "the page loaded in: " . number_format($msecs, 2) . " msecs";
-
what is your db table type? autocommit() does not work with MyISAM or ISAM, you probably know this if you read the manual
-
if you do not have the plugin installed, then yes you will be required to ask that they install it for you
-
did you properly reset all values? please post some code so we can have a look at it
-
chmod(): http://be.php.net/manual/en/function.chmod.php
-
[SOLVED] How to avoid entry in website without login.
ignace replied to shruti's topic in PHP Coding Help
when they login you set a certain value in your _SESSION variable, you check on an authorized page if that value is set, if not then redirect to the login form -
use: <input name="56" value="4" /> where 56 is the product_id and 4 the quantity when the user then presses the update button, you take the items from the shopping cart and loop over them, when an items product_id is found in the POST variable with a different value for the quantity, you perform the update
-
use fetch() instead of fetchRow()
-
yeah i think its possible but you will need to use regex to achieve it http://be.php.net/manual/en/book.regex.php
-
take a look at: http://mediumexposure.com/techblog/smart-image-resizing-while-preserving-transparency-php-and-gd-library also make sure your memory_limit is high enough to resize big images
-
using GET or POST GET: you can pass it in the url or through a form url: <a href="page.php?argument=value"> .. form: <form action="page.php" method="get"><input type="hidden" name="argument" value="value" /> POST: only through a form <form method="post"><input type="hidden" name="argument" value="value" /> type="hidden" does not necessarily be hidden, it also can be text, password, .. download a html reference XHTML 1.0 by preference
-
no it is not possible to retrieve information (due to privacy reasons) unless using ActiveX, but even then they must allow you to retrieve such information
-
<?php $num_imgs = sizeof($image_rows) - 1; $current_row = (int) $_GET['image']; $has_previous = false; $has_next = false; if ($current_row >= $num_imgs) { $current_row = $num_imgs; } else { $has_next = true; } if ($current_row <= 1) { $current_row = 1; } else { $has_previous = true; } // the image echo '<img src="' . $image_rows[$current_row]['image_path'] . '" />'; // previous echo ($has_previous ? '<a href="?image=' . $current_row . '">previous</a>' : '<b>previous</b>'); // next echo ($has_next ? '<a href="?image=' . ($current_row + 1) . '">next</a>' : '<b>next</b>');