Jump to content

Search the Community

Showing results for tags 'image linking'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I am having an issue. I have a code that works fine, but I want to remove a link within a script to another page and bundle it within the main page script so it doesn't have to go to another page. Basicly I want it to post to itself and delete a line out of mysq limit 1. Currently the script looks up the items from the sql database and posts the count of them and next to it has a link with a add 1 or remove 1. that goes to another script that works fine, just want to add it to the one bellow. I know how to do it with a form & script, but since the link/image is already in a script, I am not sure what to do. Index.php: <?php include 'connect.php'; $query="SELECT * FROM inventory WHERE `Device` = 'item1' "; $result=mysql_query($query); $num=mysql_numrows($result); if ($num> 0){ $id=mysql_result($result,$i,"Id"); $name=mysql_result($result,$i,"Name"); $discription=mysql_result($result,$i,"Discription"); $cost=mysql_result($result,$i,"Cost"); $retail=mysql_result($result,$i,"Retail"); $amount=mysql_result($result,$i,"Amount"); $device=mysql_result($result,$i,"Device"); print "<tr>"; print "<td bgcolor='#00ff00'>$num</td>"; print "<td>item 1 name</td>"; print "<td>item 1 discription</td>"; print "<td><a href='addcount.php'><img src='addcount.png'></a></td>"; print "<td><a href='deletecount.php'><img src='RenderedImage.png'></a></td>"; print "</tr>"; }else{ print "<tr>"; print "<td bgcolor='#FF0033'>0</td>"; print "<td>item 1 name</td>"; print "<td>item 1 discription</td>"; print "<td><a href='addcount.php'><img src='addcount.png'></a></td>"; print "<td>Nothing to Delete</td>"; print "</tr>"; } ?> addcount.php: <?php if (isset($_POST['submitadd'])) { $addnew = trim(stripslashes($_POST['addnew'])); include 'connect.php'; $query="SELECT `id`,`device` FROM `inventory`"; $result=mysql_query($query); $num=mysql_numrows($result); $sql = "INSERT INTO inventory VALUES('','','','','','','$addnew')"; $result = mysql_query($sql); if (!$result) { die('Invalid query: '.mysql_error()); } print "$addnew added successfully.<br />"; } ?> <form method="POST" action="<?=$PHP_SELF;?>"> ADD New:<br /> Enter Device ID: <input type="text" name="addnew"> <input type="submit" name="su'submitadd'value="SUBMIT"/> </form> These work fine separatly, but I was really wanting to combine them into 1 script, but the link to add/delete needs to be where it currently is in index.php or it will screw up the tables. Thanks for any advice
×
×
  • 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.