Jump to content

Chris Coin

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Chris Coin's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [!--quoteo(post=362125:date=Apr 5 2006, 11:11 PM:name=Hooker)--][div class=\'quotetop\']QUOTE(Hooker @ Apr 5 2006, 11:11 PM) [snapback]362125[/snapback][/div][div class=\'quotemain\'][!--quotec--] Generally, PHP files will get interpreted by the Web server and PHP executable, and you will never see the code behind the PHP file. If you make the file extension .PHPS, a properly-configured server will output a color-formated version of the source instead of the HTML that would normally be generated. [/quote] so ther isnt a certain "tag" i could use. hmmm, i guess the only way is to color the code myself.
  2. Is ther a way to show my raw code to the public with the "php colors"??
  3. [!--quoteo(post=361397:date=Apr 3 2006, 06:37 PM:name=realjumper)--][div class=\'quotetop\']QUOTE(realjumper @ Apr 3 2006, 06:37 PM) [snapback]361397[/snapback][/div][div class=\'quotemain\'][!--quotec--] I'm sure if you got creative and put on your thinking cap it could be done.....but it's simple when using a database rather than a flat file, so being a lazy person I choose the database every time!! :-) [/quote] haha i hear what your saying, im goin to try with a flat file and see if i can come up with somthing.... Thanks for all the help.
  4. [!--quoteo(post=361393:date=Apr 3 2006, 06:24 PM:name=realjumper)--][div class=\'quotetop\']QUOTE(realjumper @ Apr 3 2006, 06:24 PM) [snapback]361393[/snapback][/div][div class=\'quotemain\'][!--quotec--] A flat file.....hmmm...I could be wrong but I very much doubt it because the id is the unique identifier, which is incremented by one every time a new record is inserted in the db....something a flat file cannot do automatically. [/quote] thats what i thought, but i just wanted to make sure. it wouldnt work because when you would press the delete link, since the form would submit the same id to all post then it would delete all the post in the flat file. am i right? unless ther is away to make a script that would give out random numbers as the id, but i gess random isnt so random somtimes so maybe eventually you might delete more then one post.
  5. [!--quoteo(post=361388:date=Apr 3 2006, 06:08 PM:name=realjumper)--][div class=\'quotetop\']QUOTE(realjumper @ Apr 3 2006, 06:08 PM) [snapback]361388[/snapback][/div][div class=\'quotemain\'][!--quotec--] I'm assuming that on info.php you will have a list like.... name: (whatever) link: (whatever) description: (whatever) Delete this link name: (foo) link: (foo) description: (foo) Delete this link name: (stuff) link: (stuff) description: (stuff) Delete this link If so.....this information will come from a select query. Something like... [code] $result = mysql_query("SELECT name,link,description,id FROM table") or die(mysql_error()); echo "<table>"; while(list($name, $link, $description, $id)=mysql_fetch_array($result)){         echo "<tr>";         echo "<td>$name</td></tr>";         echo "<tr><td>$link</td></tr>";         echo "<tr><td>$description</td></tr>";         echo "<tr><td><a href=\"delete.php?id=$id\">Delete This Link</a></td></tr>";         } echo "</table>"; [/code] ....the above should do it [/quote] Yeah this is perfect. is ther a way to do the same thing if i was posting to a flat file?
  6. [!--quoteo(post=361071:date=Apr 2 2006, 08:57 PM:name=realjumper)--][div class=\'quotetop\']QUOTE(realjumper @ Apr 2 2006, 08:57 PM) [snapback]361071[/snapback][/div][div class=\'quotemain\'][!--quotec--] The 'Delete this link' just has to have the id variable of the record in the url....like for example [code] echo "<a href=\"delete.php?id=$id\">Delete this link</a>"; [/code] and on the delete.php page [code] $id=$_GET['id']; mysql_query("DELETE FROM your table WHERE id=$id"); [/code] [/quote] thanks alot, but i dont know if this will work, because when "submit.php" post to "info.php" it will create the same id for each post , then the delete link will delete all the post with same id, am i right?
  7. is ther a way to delete a post, posted to another php file Example: "index.php" post to "info.php" id like the "info.php" to display somthing like this: name: (name) link: (link) description: (description) [!--coloro:#CC0000--][span style=\"color:#CC0000\"][!--/coloro--]Delete this link[!--colorc--][/span][!--/colorc--] <---this would be a link that would delete the above lines and the only above lines, because ther will be info before and after it. is somthin like this possible?
  8. [!--quoteo(post=360576:date=Apr 1 2006, 04:44 AM:name=txmedic03)--][div class=\'quotetop\']QUOTE(txmedic03 @ Apr 1 2006, 04:44 AM) [snapback]360576[/snapback][/div][div class=\'quotemain\'][!--quotec--] Well that depends on the method so... if ($_SERVER['REQUEST_METHOD'] == "POST") $name = $_POST['name']; if ($_SERVER['REQUEST_METHOD'] == "GET") $name = $_GET['name']; That just setup our variable depending on whether you use method GET or POST, alternatively you could use $name = $_REQUEST['name'];.... if (strtolower($name) == "chris") { // Do some stuff } elseif (strtolower($name) == "john") { // Do something else } else { // Do something else because none of our conditions ever got met } I use strtolower so the condition is met even if the person typed "ChRiS" in your form. Personally I wouldn't use $name at all. I would just do... if (strtolower($_POST['name']) == "chris") // Call Function This assumes you have a function created to perform your tasks and you are using POST method, but this gives you an idea and hopefully answers your question satisfactorily. [/quote] This is perfect, it gives me a good base to start. Does anyone know of a site that will show me the basic commands wut they do and how to write them. somthing like a PHP for dummies. Goin to the official PHP site doesnt help me at all, i need some basic rules and commands just to get me started. Thanks.
  9. Thanks alot, This was exactly wut i was missing i have another question, if i wanted to say something like: if $name is "something" then (perform this command) for example in a form: if the name section of the form is filled out with the name CHRIS then (do this task)
  10. Been tryin out php for a couple days now, ive managed to create a link form that prints to another php file and is displayed on the same page as the form. Problem is when the page loads it submits an empty entry. Ive searched the net and found some complicated solutions. Was hoping to find somthing easy since im just starting. Id also like to know if it is possible to use if ($submit) to preform the rest of the code, What i mean is once the submit button was pressed then it would perform the rest of the php i.e send the form. I figure if this is possible then the form wouldnt be sent untill the submit button was pressed. Therfore no empty entries on page load. Thanks for the 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.