Jump to content

bzerr

Members
  • Posts

    5
  • Joined

  • Last visited

    Never

About bzerr

  • Birthday 04/16/1988

Contact Methods

  • MSN
    bzerr@xorz.ca
  • Website URL
    http://xorz.ca

Profile Information

  • Gender
    Not Telling
  • Location
    Cold Lake, Alberta, Canada

bzerr's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Okay, for what you're talking about, it seems that you are using include a bit too much Question 1 You can't make a button include a php file once the file is in your browser window. What you could do is make the button link to that php file, or link to the local file, with a variable in the request string, making PHP include the file itself. [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--][span style=\"color:#0000BB\"]<? [/span][span style=\"color:#007700\"]if([/span][span style=\"color:#0000BB\"]$_GET[/span][span style=\"color:#007700\"][[/span][span style=\"color:#0000BB\"]includefile[/span][span style=\"color:#007700\"]]==[/span][span style=\"color:#0000BB\"]1[/span][span style=\"color:#007700\"]) { include([/span][span style=\"color:#DD0000\"]\"myfile.php\"[/span][span style=\"color:#007700\"]); } [/span][span style=\"color:#0000BB\"]?> [/span]<td align=\"left\" valign=\"top\" ><a href=\"thisfile.php?includefile=1\" target=\"_self\"><img src=\"aboutus.gif\" alt=\"Click here to view\" width=\"143\" height=\"35\" border=\"0\"></a></td>[/span][!--PHP-Foot--][/div][!--PHP-EFoot--] Question 2 Once again use a variable on the URL, stay away from that include if you can File 1 [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--][span style=\"color:#0000BB\"]<? [/span][span style=\"color:#FF8000\"]//successful database query here [/span][span style=\"color:#0000BB\"]header[/span][span style=\"color:#007700\"]([/span][span style=\"color:#DD0000\"]\"Location: index.php?dbquerysuccess=1\"[/span][span style=\"color:#007700\"]); [/span][span style=\"color:#0000BB\"]?> [/span] [/span][!--PHP-Foot--][/div][!--PHP-EFoot--] File 2 (index.php) [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--][span style=\"color:#0000BB\"]<? [/span][span style=\"color:#FF8000\"]//your code here [/span][span style=\"color:#007700\"]if([/span][span style=\"color:#0000BB\"]$_GET[/span][span style=\"color:#007700\"][[/span][span style=\"color:#0000BB\"]dbquerysuccess[/span][span style=\"color:#007700\"]] == [/span][span style=\"color:#0000BB\"]1[/span][span style=\"color:#007700\"]) { echo [/span][span style=\"color:#DD0000\"]\"Successful Database Query\"[/span][span style=\"color:#007700\"]; } [/span][span style=\"color:#0000BB\"]?>[/span] [/span][!--PHP-Foot--][/div][!--PHP-EFoot--]
  2. [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--][span style=\"color:#0000BB\"]<? [/span][span style=\"color:#FF8000\"]//database like this // id name //-------------- // 1 Dog // 2 Fish // 3 Cat [/span][span style=\"color:#0000BB\"]mysql_connect[/span][span style=\"color:#007700\"]([/span][span style=\"color:#DD0000\"]\"localhost\"[/span][span style=\"color:#007700\"], [/span][span style=\"color:#DD0000\"]\"user\"[/span][span style=\"color:#007700\"], [/span][span style=\"color:#DD0000\"]\"password\"[/span][span style=\"color:#007700\"]); [/span][span style=\"color:#0000BB\"]mysql_select_db[/span][span style=\"color:#007700\"]([/span][span style=\"color:#DD0000\"]\"test\"[/span][span style=\"color:#007700\"]); [/span][span style=\"color:#0000BB\"]$res[/span][span style=\"color:#007700\"]=[/span][span style=\"color:#0000BB\"]mysql_query[/span][span style=\"color:#007700\"]([/span][span style=\"color:#DD0000\"]\"SELECT * FROM product\"[/span][span style=\"color:#007700\"]) or die([/span][span style=\"color:#0000BB\"]mysql_error[/span][span style=\"color:#007700\"]()); echo [/span][span style=\"color:#DD0000\"]\"<select name=myselect>\"[/span][span style=\"color:#007700\"]; while([/span][span style=\"color:#0000BB\"]$row[/span][span style=\"color:#007700\"]=[/span][span style=\"color:#0000BB\"]mysql_fetch_assoc[/span][span style=\"color:#007700\"]([/span][span style=\"color:#0000BB\"]$res[/span][span style=\"color:#007700\"])) { echo [/span][span style=\"color:#DD0000\"]\"<option value=$row[id]>$row[name]</option>\"[/span][span style=\"color:#007700\"]; } echo [/span][span style=\"color:#DD0000\"]\"</select>\"[/span][span style=\"color:#007700\"]; [/span][span style=\"color:#0000BB\"]?>[/span] [/span][!--PHP-Foot--][/div][!--PHP-EFoot--]
  3. Try this out [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--]<select name=\"recordID\"> <option value=\"blah1\">Option 1</option> <option value=\"blah2\">Option 2</option> <option value=\"blah2\">Option 3</option> </select>[/span][!--PHP-Foot--][/div][!--PHP-EFoot--]
×
×
  • 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.