Hey,
I have been searching for how to create nodes in Drupal 6. I found some entries here on stackoverflow, but the questions seemed to either be for older versions or the solutions did not work for me. Ok, so here is my current process for trying to create
$node = new stdClass();
$node->title = "test title";
$node->body = "test body...
I am using a form to "Rate" a page. This form "posts" data to a php script elsewhere. I simply want to display a link after the form is processed which will bring the user back to previous page. Can I do this using javascript in my php script?
GF
...
Hey guys I have an admin page that checks if you are admin before submitting any queries, and contains a header to the index page if you are not admin, but I am worried about protecting the page. I am concerned someone may be able to destroy my database with it. Does anyone have any recommendation into protecting a page like this, if not...
I feel very very very silly posting this, but I can't find the answer. I've searched google and here.
// originally values in a multi dimensional array, but used simple values
// to rule out errors.
$somenumber = 1; $anotherone=5;
if ($somenumber < $res->shares < $anotherone ) {
//blah
}
Get the error:
Parse error: syntax error...
I have a table that describes a variety of objects in my system (ie. umbrella, boots, satchel, whatever). Each one of these objects needs to have a distinct prevalence or incidence. For example, the umbrella is rarer than the boots. Based on those factors, I need to randomly select a single object (including a blank or 'no object found')...
I have the following if condition statement
if ( (strlen($data[70])>0) || ( (remove19((trim($data[29])) == '7135556666')) && isLongDistance($data[8])) )
where $data is a recordset from a database.
My goal is to include all rows where $data[70] isn't blank, and also include rows where $data[29] = 713555666 && $data[8] isLongDistan...
Hello, how made in PHP from format 52.593800, 21.448850 format +52° 35' 37.68", +21° 26' 55.86" like do it google http://maps.google.pl/maps?hl=pl&t=m&q=52.593800,21.448850 ?
...
I have an upload form with a file to be uploaded. The issue I have is that even when no file is uploaded the if(isset($_FILES)) OR if(!empty($_FILES)) still passes as successful:
$_FILES = $HTTP_POST_FILES;
if($_POST['type'] == 'photo' && isset($_FILES)){
// returns true even if no file is uploaded. What am I missing!
}
...
Hey.
I need some help to insert comma separates strings into multiple columns into db.
My $_POST['search'] value output. [search] => schools,books,mobile
How do i make an foreach or for to insert those data into db? :S
...
Hi guys, I'm having trouble with this PHP function. It keeps returning zero, but I know the SQL statement works because I've queried it myself. Any ideas what I'm doing wrong? The last line makes no sense to me...I'm editing this code that someone else wrote. This function should return a number in the hundreds, assuming the date is ...
Ok so i have a template script my friend built for me. I'll include all file names.
OK so what is not working is file_get_contents is not grabing the content
(1 I don't know where the content should be placed.
(2 I want it placed in a directory so that IF i change the template the area where content stays is the same.
(3 I'm trying...
Trying to implements simple privileges for admin user. Don't need huge acl rules and groups system. There are admin users, overs - just registered users. They can't access actions with admin prefix. So It was implemented in cakephp1.2 version with following code in app_controller:
function isAuthorized() {
if (isset($this->params[Co...
I've been using prepared statements for a little while now and I've never had any problems.
Now I'm trying to:
$sql="SELECT PhotoID,Caption FROM Photos WHERE EntityID=? AND TypeID=? LIMIT ?,?";
$iDB = new mysqliDB(); // Extends mysqli
$stmt = $iDB->prepare($sql);
$stmt->bind_param('iiii',$entityID,$typeID,$minRange,$maxRange);
$stm...
I have a survey application, where users can create surveys and give choices for every survey. Other users can choose their answers for the aurvey and then polls are taken to get the results of the survey.
I already have the database schema for this
Questions
id, user_id, category_id, question_text, date_started
Answers
id, user_id, q...
I am working with a CMS-type site in Symfony 1.4 (Doctrine 1.2) and one of the things that is frustrating me is not being able to store HTML pages in YML fixtures. Instead I have to create SQL backups of the data if I want to drop and rebuild which is a bit of a pest when Symfony/Doctrine has a fantastic mechanism for doing exactly this....
After changing the freetds.conf file, do I need to restart anything to see the changes in running ODBC queries from PHP?
...
I'm very surprised I couldn't find this question here, which makes me very sure it is here and I just didn't see it. Regardless, I'll ask again.
How do I echo a forwardslash "/"?
echo <?php echo $_SERVER['HTTP_HOST'] ?> . '/directory/';
Thanks
-J
...
Ok, not really sure how to do this. I have values that are being outputted from a SQL query like so:
$row[0] = array('lid' => 1, 'llayout' => 1, 'lposition' => 1, 'mid' => 1, 'mlayout' => 1, 'mposition' => 0);
$row[1] = array('lid' => 2, 'llayout' => 1, 'lposition' => 0, 'mid' => 2, 'mlayout' => 1, 'mposition' => 0);
$row[2] = array('l...
I'm creating a web app (locally, so security doesn't matter) in PHP where the user uploads a set of information and a small .jpeg, which is then inserted into a mySQL table. I can do this no problem with all the text data, but I'm not sure how to cause the image to upload alongside it. I assume I will have to use the blob data type and...
I can not understand the difference.
...