Jump to content

f.ismayil

Members
  • Posts

    50
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

f.ismayil's Achievements

Member

Member (2/5)

0

Reputation

  1. I do not know what is XAMPP or WAMP. Also is PEAR and PECL the same things?
  2. RussellReal as I see you have an experience in installing extensions. I need to install this extension both on local Windows 7 PC and on my hosting. I will put a ticket to hosting admins to install this extension. pecl install <extension name> command I have seen in documentation also. But I do not know where exactly to write it? When I open command prompt and write this command I just receive error message that unrecognised command.
  3. I have never installed packages before. So I do not know the way of doing it. After unpacking archive file I have 1 package.xml file and one folder with lots of files of *.c and *.h extention. What should I do with these files?
  4. I am trying to use "http_post_data" command inside my code. I have downloaded required package from http://pecl.php.net/package/pecl_http link and placed "pecl_http-2.0.0dev1" folder into inetpub of my local webserver. What I do not know is how to install it? All documentations that I read are very complicated and I can not install PECL. Please, help me.
  5. In <head> section of my website I have the following code: <script type='text/javascript' src='stmenu.js'></script> In the body section of my website I have very long code that builds menu. I need to put this code into menu.js and call this file. Code inside <body> is too long so I attached file containing this code. How may I call menu.js file? <script type='text/javascript' src='menu.js'></script> code is not working. [attachment deleted by admin]
  6. Before openning products.php I need to send $_POST variable to it. How to do it? who has ready code?
  7. Should I write something like that? $userid = $_POST['userid']; http_post_data("product.php", $userid); If this code is correct should I call products php before this code or after? I would highly appreciate working code?
  8. I have tilbud.php file that has no output. Just receives data and adds them into MySQL table. Inside tilbud.php file I have JavaScript code that calls products.php. Product.php has the following code: if(!isset($_POST['userid'])) { echo "<script type='text/javascript'>"; echo "window.location = 'index.php'"; echo "</script>"; exit; } So, I you call product.php without submitting $_POST['userid'] it redirects you into index.php. How to submit $_POST['userid'] into products php without using <form method='POST' action='product.php'> ?
  9. I have already found my own mistake. Closing </table> tag is not in correct place :-) echo "<tr>"; if(!mysql_num_rows($result)){ echo "<td valign='top' width='150' height='300' bgcolor='white' cellpadding='0'>"; echo "<img src='note.jpg'>"; }else{ echo "<td valign='top' width='150' height='300' background='tilbud2.jpg' cellpadding='0'> <table border='0' width='150' style='table-layout:fixed' cellspacing='0'> <col width='120'> <col width='30'> <tr><td colspan=2><center><b>Dagens tilbud</b></center><br></td></tr>"; while($row = mysql_fetch_array($result)){ echo "<tr><td>"; $product = $row["Product"]; $price = $row["Price"]; echo "$product"; echo "</td>"; echo "<td>" . "$price" . "</td></tr>"; } echo "</table>"; } echo "</td></tr>
  10. One more note. When remove second <img> tag and write just echo "a"; it also writes letter a in another row. if(!mysql_num_rows($result)){ echo "a"; }
  11. Thanks fugix for reply. I modified code as you said. Still the same thing. One <td> do not fit into <tr> and goes down. I even decreased width and height of picture. It also doesn't help
  12. Looks like HTML problem. But can not put this question in HTML section cause it has PHP code. I have table. I have 3 rows. 1 of rows has rowspan with 2 other rows.Problem is when database is empty program should take one picture and put inside 2 cells of table. First picture sits inside td normally but second picture not fitting into td and gows out of <tr>. Do not know what to do. echo "<tr> <td rowspan='2' width='1000' height='600'> <div id='fadeshow1'></div> </td> <td valign='top' height='300' background='tilbud.jpg'>"; if(!mysql_num_rows($result)){ echo "<img src='note.jpg'>"; }else{ echo "<table border='1' width='120' style='table-layout:fixed' cellspacing='0'> <tr><td colspan='2'><center><b>Ukens tilbud</b></center><br></td></tr>"; while($row = mysql_fetch_array($result)){ echo "<tr><td>"; $product = $row["Product"]; $price = $row["Price"]; echo "$product"; echo "</td>"; echo "<td>" . "$price" . "</td></tr>"; } } echo "</table></td></tr>"; $query = "SELECT Product, Price FROM tilbud WHERE Period='Daglig'"; $result = mysql_query($query,$link_id) or die (mysql_error()); echo "<tr background='tilbud.jpg'> <td valign='top' height='300' width=120 background='tilbud2.jpg'>"; if(!mysql_num_rows($result)){ echo "<img src='note.jpg' width='120'>"; }else{ echo "<table border='1' width='120' style='table-layout:fixed' cellspacing='0'> <col width=110> <tr><td colspan=2><center><b>Dagens tilbud</b></center><br></td></tr>"; while($row = mysql_fetch_array($result)){ echo "<tr><td width='110'>"; $product = $row["Product"]; $price = $row["Price"]; echo "$product"; echo "</td>"; echo "<td>" . "$price" . "</td></tr>"; } echo "</table>"; } echo "</td></tr>
  13. I will have lots of links inside my site. I will have the same banner inside all pages. Is it possible to use Server Side Include for this purpose? Something like that: <!--#include virtual="page.html"-->
  14. Please, take a look to the following code.After clicking Next it goes to overview.php.Why when I click back on my browser to return to this page again, it is not returning back? When I click back I receive "Confirm Form Resubmission" message. After refreshing page it loads page. I guess problem is in "session_start();" part. Something to do with cookies. Please, help me it is very urgent for me. <?php session_start(); echo "<html> <head> <title>Hello World</title> <meta http-equiv='Content-Type' content='text/html; charset=Windows-1252'/> </head>"; require_once ('functions.inc'); if(!isset($_POST['userid'])) { echo "<script type='text/javascript'>"; echo "window.location = 'index.php'"; echo "</script>"; exit; }else{ session_register("userid", "userpassword"); $username = auth_user($_POST['userid'], $_POST['userpassword']); if(!$username) { $PHP_SELF = $_SERVER['PHP_SELF']; session_unregister("userid"); session_unregister("userpassword"); echo "Authentication failed " . "Please, write correct username or password. " . "try again "; echo "<A HREF=\"index.php\">Login</A><BR>"; exit; } } function auth_user($userid, $userpassword){ global $default_dbname, $user_tablename; $user_tablename = 'user'; $link_id = db_connect($default_dbname); mysql_select_db("d12826", $link_id); $query = "SELECT username FROM $user_tablename WHERE username = '$userid' AND password = '$userpassword'"; $result = mysql_query($query) or die(mysql_error()); if(!mysql_num_rows($result)){ return 0; }else{ $query_data = mysql_fetch_row($result); return $query_data[0]; } } echo "hello"; echo "<form method='POST' name='myform' action='overview.php'>"; echo "<input type='submit' value='Next'>"; echo "</form>"; ?>
  15. Sorry I have posted wrong picture. Here is the correct one. Actually I am not going to edit data myself. I am going to make same page and let owner of website to edit table sometimes. Generanlly he will only remove some records and add some. I do not want to give him ability to delete fields. [attachment deleted by admin]
×
×
  • 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.