Jump to content

ted_chou12

Members
  • Posts

    1,488
  • Joined

  • Last visited

Everything posted by ted_chou12

  1. id and name refers to the column, for each table u would have columns and rows, rows are just ur entries, and columns r different variables u can store for each entry: idname ted_chou12Ted snuggles79snuggles Ted
  2. <h2 class='boxtitle'>Meta Description</h2> <textarea class=editblocktext name='metadesc' > <? echo htmlentities($rows['metadesc']); ?> </textarea> <br><br> Ted
  3. I am not sure exactly what u r trying to achieve here ??? The php I am familiar is to define a variable as $var = "string"; Ted
  4. http://us.php.net/manual/en/function.mysql-fetch-array.php <?php mysql_connect("localhost", "mysql_user", "mysql_password") or die("Could not connect: " . mysql_error());// connect to db mysql_select_db("mydb"); $result = mysql_query("SELECT id, name FROM mytable"); //ur query here while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { printf("ID: %s Name: %s", $row["id"], $row["name"]);//echo out here } mysql_free_result($result); ?> Ted
  5. The best way is start coding, personal comments>> reading tones of manuals tutorials isnt the same as trying ur self, try to code for simple script like a guestbook or something. Ted
  6. im not familiar with the language u r using but I guess u should try this: $constant = "Hello world."; echo $constant; //gives u Hello world.
  7. Put this in verify.php: <?php if (isset($_POST['submit'])) { $user = $_POST['username']; $email = $_POST['email'];} change register.php to this: <FORM NAME="frmSuccess" METHOD="post" ACTION="verify.php"> <INPUT TYPE="hidden" NAME="email" VALUE="<?php echo $email?>"> <INPUT TYPE="hidden" NAME="username" VALUE="<?php echo $username?>"> <input type="submit" name="submit" /> </FORM>
  8. in php variables are usually defined like: $home = "home";//u have to surround texts by quotation marks echo $home; //gives u home. echo "if"; //gives u if echo "and"; //gives u and but the chinese character has nothing to do with this, is the charset problem Ted
  9. this is the page u want html to store in: <?php echo "test";?> <script type="text/javascript"> <!-- window.location = "test.php" //--> </script> download page separate here: <?php header('Content-type: application/txt'); header('Content-Disposition: attachment; filename="3.txt"'); readfile('3.txt'); ?> Ted
  10. After some investigation, i think this is done with javascript: http://tedchou12.110mb.com/uploads/phpforcedownload.php try if this is what u want Ted
  11. <?php // We'll be outputting a PDF header('Content-type: application/txt'); // It will be called downloaded.pdf header('Content-Disposition: attachment; filename="somefile.txt"'); // The PDF source is in original.pdf readfile('somefile.txt'); ?> dont forget to replace the somefile with ur own txt file name, Ted
  12. try adding this to the first page: <?php session_start(); if (isset($_POST['KT_Insert1'])) { $add = $_POST['Address']; $_SESSION['Address'] = $add;} ?> //this to the second page: <?php session_start(); echo $_SESSION['Address']; ?> Ted
  13. I'm confused, how do your two scripts relate? are they on the same page or different page? are u trying to pass variable to another page??? Ted
  14. try this: <?php if (isset($_POST['submit'])) { $number = $_POST['submit']; $array = (0 => 0, 10000 => 4, 20000 => 8,//finish the table with your data) foreach ($array as $key => $val) { if ($number == $key) {echo "matched figure!";}} ?> <input name="name" type="text" size="30" /> <input name="submit" type="submit" />
  15. I think is the problem saving the file, ??? but I am not sure about these functions, Ted.
  16. if u really want to put it in public_html, try adding a htaccess file that includes the following lines: Order Deny,Allow Deny from all but u have to add this to a folder and have that file u wish not to be accessed directly in the same directory. Ted.
  17. in that case, since u have specific variable, try: $text = str_replace($search, $replace, $line);
  18. I believe you can, try preg_replace(); u can use regex syntax to capture some kind of variation between <form>*.?</form> but im not an expert in that, u have to ask someone how that regex works. Ted
  19. yeap i have the same problem as well
  20. I dont quite understand the code, but there are multiple strings in an array, u can call up the string u want by specifying the position of the string through sequence by number eg. $array[0] or a unique id of an associative array $array['key'], in ur case i think you are trying to do this: if ($array['Jeff,employee'] == $string) {//do something here} Let me know if i misunderstood u, Ted
  21. still no answers ???
  22. <?php if (isset($_POST['search'])){ $query = $_POST['search_query']; header("location: search.php?q=$query");} ?> <form method="post" action="search.php?q="> <p><input type="text" name="search_query" class="textbox" /> <input type="submit" name="search" class="button" value="Search" /></p> </form>
  23. <?php while (query...) { $array[] = array($row['id'], $row['name']); $namearray [] = $row['name'];} array_unique($namearray); foreach ($array as $a) { foreach ($namearray as $b) { echo "<tr> <td>name: $b</td>"; if ($b = $a[0]) { echo "<td> id: {$a[1]}</td>";} echo "</tr>";}}} ?> sounds pretty complicated
  24. null means the variable is empty, u should probably post some more codes up. Ted
  25. Hi there, from the code you've shown here, everything seems to be okay, maybe you can post other codes of your script. Ted.
×
×
  • 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.