Jump to content

scadran

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

About scadran

  • Birthday 05/24/1985

Contact Methods

  • Website URL
    http://www.emuchix.com
  • Yahoo
    scadran2000

Profile Information

  • Gender
    Male
  • Location
    Famagusta - Cyprus

scadran's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. what am i including? nothing really .... The page is displayed completely and correctly ... but i need to know why should i have that warning at the very top of the page!? is there something wrong with this part? echo $cart; $cart = $_SESSION['cart']; require_once('inc/functions.php'); include('config.php'); ?> cause this is the only part which i ve included and then recieved the warning!?
  2. I am not sure what u mean ... but if u mean the philosophy.php file, then I ve opend the file via the browser ... I am running it on my own server.
  3. Hi guys My codes arw as follow: <?php // Start the session session_start(); // Process actions $cart = $_SESSION['cart']; $action = $_GET['action']; switch ($action) { case 'add': if ($cart) { $cart .= ','.$_GET['id']; } else { $cart = $_GET['id']; } break; case 'delete': if ($cart) { $items = explode(',',$cart); $newcart = ''; foreach ($items as $item) { if ($_GET['id'] != $item) { if ($newcart != '') { $newcart .= ','.$item; } else { $newcart = $item; } } } $cart = $newcart; } break; } $_SESSION['cart'] = $cart; ?> <html> <head> <?php echo $cart; $cart = $_SESSION['cart']; require_once('inc/functions.php'); include('config.php'); ?> <meta http-equiv="Content-Type" content="text/html; charset=windows-1256"> <link rel="stylesheet" type="text/css" href="style.css"> <title>جزئ&#1740;ات سبد خر&#1740;د شما</title> <script type="text/javascript" language="JavaScript1.2" src="_pgtres/stmenu.js"></script> </head> <body background="images/fa_mainbg.gif"> ........... Why do i recieve tis error? Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\wamp\www\pangaan\philosophy.php:4) in C:\wamp\www\pangaan\philosophy.php on line 5
  4. Hi guys I am about to do two different actions on the same form with the same data. What I have done so far is that First: I have created two different submit button with the same name and different value <input type="submit" value="Publish Invoice" name="flag"> <input type="submit" value="Summary Report" name="flag"> in the action page I have got the data with POST and check the status of the submit value: <?php $flag = $_POST['flag']; if ($flag=='Publish Invoice') include('publish.php'); else { include('summary.php');} ?> when i press publish invoice buttomn i recieve the following error: Parse error: syntax error, unexpected '}' in C:\wamp\www\Pierra Invoice\publish.php on line 99 Just in case if you need the publish.php page, here it is: include('config.php'); $result = mysql_query("SELECT * FROM temp") or die(mysql_error()); $row = mysql_fetch_array($result); $cnt=1; $new_no = $row[6]; while ( $cnt <= $row[5] ) { $cd='a'.$cnt; $code = $_POST[$cd]; $tyre_arr = mysql_query("select * from tyre where code='$code'") or die(mysql_error()); $tyre = mysql_fetch_array($tyre_arr); ?> <div align="center"> <center> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-style: double; border-width: 3" bordercolor="#111111" width="1024" height="430"> <tr> <td width="100%" dir="rtl" height="430"> <img border="0" src="PIERRA%20LOGO.jpg" width="93" height="88" align="right"><div align="left"> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="30%" > <tr> <td width="50%"><font face="B Compset" size="4"> شماره فاکتور:</font></td> <td width="50%"><font face="B Compset" size="4"> <?php if (strlen($new_no)==1) echo "0000".$new_no; elseif(strlen($new_no)==2) echo "000".$new_no; elseif(strlen($new_no)==3) echo "00".$new_no; elseif(strlen($new_no)==4) echo "0".$new_no; else echo $new_no; ?> </font></td> </tr> <tr> <td width="50%"><font face="B Compset" size="4"> تار&#1740;خ: </font></td> <td width="50%"><font face="B Compset" size="4"><?php echo $row[2]."/".$row[3]."/".$row[4]?></font></td> </tr> </table> </div> <p align="center"><font face="B Jadid" size="5">فاکتور سفارش</font></p> <p> <font face="B Compset" size="4"> نام خر&#1740;دار: <?php echo $row[1]?></font></p> <div align="center"> <center> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="90%" id="AutoNumber3" height="52"> <tr bgcolor="#C0C0C0"> <td width="20%" align="center" height="19"><b><font face="Tahoma">کد پ&#1740;را</font></b></td> <td width="20%" align="center" height="19"><b><font face="Tahoma">سا&#1740;ز</font></b></td> <td width="20%" align="center" height="19"><b><font face="Tahoma"><span lang="en-us"> Serial Number</span></font></b></td> <td width="20%" align="center" height="19"><b><font face="Tahoma"><span lang="en-us"> Brand</span></font></b></td> <td width="20%" align="center" height="19"> <p dir="ltr"><b><font face="Tahoma"><span lang="en-us"> Price (Rial)</span></font></b></td> </tr> <tr> <td width="20%" align="center" height="32"> <font face="Tahoma" size="2"><span lang="en-us"><?php echo $tyre[0] ?></span></font></td> <td width="20%" align="center" height="32"><span lang="en-us"><p dir="ltr"> <font face="Tahoma" size="2"><?php echo $tyre[1] ?></font></span></p></td> <td width="20%" align="center" height="32"><span lang="en-us"> <font face="Tahoma" size="2"><?php echo $tyre[2] ?></font></span></td> <td width="20%" align="center" height="32"><span lang="en-us"> <font face="Tahoma" size="2"><?php echo $tyre[3] ?></font></span></td> <td width="20%" align="center" height="32"><span lang="en-us"> <font face="Tahoma" size="2"><?php echo number_format($tyre[4]) ?></font></span></td> </tr> <tr> <td width="80%" align="center" height="32" colspan="4"> <p align="right"><font face="Tahoma" size="2"><span lang="en-us"> </span>سه درصد عوارض فروش</font></td> <td width="20%" align="center" height="32"><?php echo number_format(0.03*$tyre[4]) ?></td> </tr> <tr> <td width="80%" align="center" height="32" colspan="4"> <p align="right"><font face="Tahoma" size="2"> </font> <font face="Tahoma">جمع کل:</font></td> <td width="20%" align="center" height="32" bgcolor="#CCCCCC"><?php echo number_format(0.03*$tyre[4]+$tyre[4]) ?></td> </tr> </table> </center> </div> <p> </p> <p > <br> اداره فروش </font> </p> <p align="left"> </p> </td> </tr> </table> </center> </div> <p align="center"> --------------------------------------------------------------------------------------------------------------</p> <?php $new_no = $row[6]+$cnt; $mosi = mysql_query("UPDATE temp SET last_invoice='$new_no' WHERE id='0'") or die(mysql_error()); $cnt = $cnt+1; } ?> tell me what is wrong now? ???
  5. Hi guys I have a page in which i will ask the user to enter number of people. according to their answer I will create textbox the same amount as they gave the answer. they complete the text box and i want to send it to the other page by POST. how can I take them in a while loop by the next page? Can someone help me here are my codes: within the page which create the nested textboxes: $counter = 1; while ( $counter <= $no ) { echo "<input type=\"text\" name=\"".'a'."$counter\" size=\"6\"> "; $counter = $counter + 1; } ?> within the page which i want to recive them: $result = mysql_query("SELECT * FROM temp") or die(mysql_error()); $row = mysql_fetch_array($result); $cnt=1; $new_no = $row[6]; while ( $cnt <= $row[5] ) { $cd='a'.$cnt; $code = $_POST['$cd']; echo $code; $tyre_arr = mysql_query("select * from tyre where code='$code'") or die(mysql_error()); $tyre = mysql_fetch_array($tyre_arr); ?> I guess there should be something wrong with this line: $code = $_POST['$cd']; any idea?
  6. I am getting a date entry through POST by a form byt the format enetered by the user is 'dd/mm/yy' .... how could i use MYSQL PHP syntax to insert the proper format as it is default in the table in my database. which function is it? Rgards
  7. hey guys I have just designed a BD. there are companies with auto increament which are integer. When I try to populate it after i tool value from another form and try to insert it into a table i recieve an error! I don't ask the companyID value from user as it is auto increament. Don't tell me to put NULL for that entry as it didn't work as well! here are codes: <?php include 'config.php'; $comp_name = $_POST['companname']; $desc = $_POST['desc']; $telephoneno = $_POST['tel']; $own = $_POST['owner']; $sql = "INSERT INTO company ( description , telephoneno , owner , compname, compid ) VALUES ($desc, $telephoneno, $own, $comp_name, NULL)"; $result = mysql_query($sql) or die('Query failed. ' . mysql_error()); header('location: panel.php'); ?> Any idea what should i do to not recieve Query failed. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near .... Thanks Guys waiting for ur answers!
  8. so how about the rest of the file content which needs to be written in the same file? Shall I open the <?php tag again? any btw it didn't solve the problem... same error occurs! more idea?
  9. guys, here is the simple code i used to create a RSS but this error appears Parse error: syntax error, unexpected T_STRING in C:\wamp\www\Journalness\rss.php on line 11 here is the code: <?php $connection = mysql_connect("localhost", "root", "123"); mysql_select_db("emu", $connection); $select = "SELECT `id`, `title`, `entry_text`, `date` FROM `emu_entries` ORDER BY `id` DESC LIMIT 5"; $query = mysql_query($select) or die(mysql_error()); $file = fopen("rss.xml", "w") fwrite($file, "<?xml version="1.0"?> <rss version="2.0"> <channel> <title>The Shadow Fox Feed</title> <link>http://www.shadow-fox.net</link> <description>Feed Description</description> <language>en-us</language>"); while($array = mysql_fetch_array($query)){ extract($array); $content = htmlentities($entry_text); fwrite($file, "<item> <title>$title</title> <link>http://localhost/Journalness/past.php?id=$id</link> <description>$content</description> </item>"); } //end of while loop fwrite($file, "</channel></rss>"); fclose($file); ?> I am sure there s no problem with my database connection and the file previlage. Regards Mohsen
  10. Hey guys I have just installed PHP with MySql with Apache server. I have installed PHPMyAdmin too. I could successfully enter to PHPmyAdmin and login and use it properly. But when I code a PHP source myself and call it from localhost, nothing displays. I have debugged the php file in Zend Studio. It gave me this error: [b]"Debug Error: ..\config.php line 11 - Call to undefined function mysql_connect()"[/b] To tell you that I am sure about the correctness of my codes, I have paste them here: [color=red] [font=Verdana]$link = mysql_connect($db_host, $db_user, $db_pass); if (!$link) {     die('Could not connect: ' . mysql_error());             } echo 'Connected successfully';[/font][/color] What do you think the problem is? Can anybody help???
×
×
  • 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.