Jump to content

hmdnawaz

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Everything posted by hmdnawaz

  1. your question was that you could not see the error logs for php. I presumed you were looking at the default server error logs. Whereas the php error logs are stored under the apache directory: /var/log/apache/error.log my error log file is in the /var/log/php/errors.log.
  2. What should I do in /var/log/apache2? Should I change something there?
  3. I have check and the error reporting is set to 1 and display_errors are Off.
  4. The php errors are not logged to the errors.log file. What can be the reason. In my php.ini file the the error_log_max_len = 1024. What should I change in the php.ini file so that my problem solve?
  5. I want to pass a js variable to drupal php variable and display its value. Following is my code. $form['title'] = array( '#type' => 'select', '#title' => t('titles'), '#page callback' => 'drupal_get_form', '#page arguments' => array('test_select'), '#access callback' => TRUE, '#options' => $options, '#prefix' => '<div>', '#postfix' => '</div>', '#attributes' => array('onchange' => 'test_change') ); $form['titletext'] = array( '#type' => 'textfield', '#title' => 'title', ); drupal_add_js('$('.$form['title']['select'].').change(function () { var str =""; '.$a.' = ""; $("'.$form['title']['select'].' option:selected").each(function () { str += $(this).text() + " "; }); }) .change();', 'inline', 'header'); I want to assign that str variable to the textfield value or simply assign that variable to drupal php variable and display it on the page.
  6. yes every friday morning. I wrote this if(date('D') == 'Fri') Is this correct?
  7. I want to recieve emails on weekly manner from thursday to thursday. For this how can i set the variables to pass to the sql query. I worte this $start_date = mktime(0, 0, 1, date("m"), date("j")-7, date("Y")); but it will calculate date from today. And I want to recieve emails on every friday morning. So please write the code for me also write the end date. Thanks in advance.
  8. It will generate a random number but i want a UNIQUE random number to be generated.
  9. How to generate a unique random number in php??? Any one who can help me?
  10. I am calculating the values of dropdown list from the title field of the events table. As title field may contains same names in different rows. Suppose the title field contains "Meeting" in two different rows.Then in Meeting appears twice in my dropdown list and i want it to appears once as the name is same.
  11. I have a dropdown list which have some elements. I want to get all the elements of the dropdown list into a variable of type array. Any Idea???
  12. What this function do? putenv("TZ=Asia/Karachi"); please send me the complete code step by step Like the following. 1. Get server datetime 2.convert to Asi/Karachi timezone 3. print the converted datetime. Thanks
  13. I have a varaiable which gets the server time; $date =date("Y-m-d H:i:s"); suppose the server is in the USA then it the timezone of this date will be the timezone of USA. And i want to convert this timezone to Asia/Karachi timezone. Any Idea about this???
  14. when i write the page name in the action attribute of the form then problem creates in updating the form. Any alternative approach??
  15. I have two pages. one is insert_events.php and the other is veiw_events. In insert_events i have a form which have a submit button. I want when i click on the submit button, it redirects me to the view_events.php page showing the events. Any idea about this problem will be appreciated. Thanks
  16. but db.php have a class and a function. How can i call that function from the submit button of form.php?
  17. I have two pages one is db.php and another is form.php. In form.php i have created a form which contains different fields and a submit button. But i want to write the queries in db.php. And when i click on the submit button the insert query in db.php should be executed and insert data in database but the focus remains on form.php. How can i do this??? Any Idea?
  18. function htmlEventFormGenerator($asd){ $out = '<form id="mainform" enctype="multipart/form-data" action="index.php" method="post"><div class="eventdiv"><h2 class="contentHeading">Add Event</h2>'; ?> <div class="divInner1"> <?php include('fckeditor.php'); $oFCKeditor = new FCKeditor('description') ; $oFCKeditor->BasePath = $sBasePath ; $value2 = $oFCKeditor->Value = 'ahmad'; //$value2 = $oFCKeditor->Value; $oFCKeditor->Height = '100px'; $oFCKeditor->Create(); ?> </div> <?php $sql="SELECT title FROM events"; $r = mysql_query($sql); $out.="<label>Display on front screen</label><Input type = 'checkbox' name ='displayonfront' value= '1'/><br><br>"; $out.='<label>Parent</label>'; $out.='<SELECT name ="eventparent">'; $out .='<OPTION value="0">'."Null".'</OPTION>'; while ($row = mysql_fetch_array($r)){ $out .='<OPTION value="'.$row['title'].'">'.$row['title'].'</OPTION>'; } $out.='</SELECT>'; $zain = $_POST["date"]; echo $zain; foreach ($asd as $key => $value){ $out.= "<div><label>$value[label]</label><input type='$value[type]' name='$key' value='$value[value]'/></div> <br>"; if($key=="title"){ $out.= '<div><label>Event Date</label><input type="text" id="myDate" name="date" /><a href="javascript:NewCal(\'myDate\',\'yyyymmdd\')"><img src="images/cal.gif" width="22" height="22" border="0" alt="Pick a date"></a></div>'; } if($key=="place"){ $out.= '<div><label>Event Description</label></br></br></br></br></br></br></br></br></div>'; } } $out.= "<input type='hidden' value='$value2' name='description'></input></div></form>"; return $out; } The above function creates a dynamic form and in that function i write the code of fckeditor. The database insertion is on another page. when i run the code it only save the default value of fckeditor in database which is ahmad and not any other text entered after execution. What is the problem?? Please help me.
  19. I am creating a dynamic form in php. And i want to add fckeditor to this dynamic form. so any idea about to add fckeditor to a dynamically creating form in php??? Any Help please???
  20. I have two pages of php. one is page1.php and the other is page2.php. In page1.php there is a function which dynamically creates a form of html and return the full form at the end of the function. And I want to the function to return a 2nd variable with the form. and i get that variable on page2.php. How can i do this???
  21. Please ellaborate that how you do the same task??? Thanks
  22. I have downloaded the CKeditor and used it in my php code. but when i try to include it in my page, it always appears on the top of my page and i want it to appear at the bottom or at the middle of the page with a specific field in the form. Any idea about this???
  23. here is my php code. i want to remove the attribute of a tag and then add a new attribure to the tag. simply i want attribute validation. but this code gives me the following error. "Fatal error: Call to a member function getAttributeNode() on a non-object in D:\wamp\www\ReadXml\new.php on line 35" <?php $xml = new DOMDocument(); $doc->recover = true; $xml->load('test.xml'); $node = $xml->getElementsByTagName('*'); $nodename = ""; $node_name = array(); $att = ""; $attr_name = ""; $attr_value = ""; foreach($node as $value) { echo "<HTML><Head>"; echo "<title> Getting Attribute Example</title>"; echo "</Head><body><B>"; echo "Node Name is :".$value->nodeName; echo "<br /><br /></B></body></HTML>"; $nodename = $value->nodeName; $node_name = $xml->getElementsByTagName('$nodename')->item(0); echo $nodename; $att = $node_name->getAttributeNode('name'); //Line No 35 echo "<HTML><Head>"; echo "<title> Getting Attribute Example</title>"; echo "</Head><body><B>"; echo "Node Name is :".$att->name; echo "<BR>Attribute Value is :".$att->value; echo "<br /><br /></B></body></HTML>"; $attr_name = $att->name; $attr_value = '"' . $att->value . '"'; $nodename->removeAttributeNode('$attr_name'); $nodename->setAttributeNode(new DOMAttr('$attr_name', 'hello')); $nodename->setAttribute(new DOMAttr('$attr_name', '$attr_name')); $xml->save('temp2.xml'); } ?>
×
×
  • 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.