Jump to content

ToonMariner

Members
  • Posts

    3,342
  • Joined

  • Last visited

Everything posted by ToonMariner

  1. Shogun, sorry for banging on but the html form as the email or e-mail the link is truely the option for you.... Why? You are relying on the user replying or even worse typing in an e-mail address.... Because you can control how the user submits data (simply having 2 e-mail addresses does in no-way ensure that you can extract all the data you need - the user WILL do something you don't expect THEY WILL!!!!!!!!!!! the body may contain your information but in what order? and how do you know everyone will stick to that order/format?) AND The information is processed instantly - don't have to worry about a cron job or shell scripts. not calling anyone stupid but the addage [b]K[/b]eep [b]I[/b]t [b]S[/b]imple [b]S[/b]tupid is what is often needed.....
  2. you would have to make page2 a php file so it could do something with the variables posted/got from the form previously.  Then have the source of teh iframe set to page.php?var1=x&var2=y you would generate the strings through php for teh url.... hope that helps but the real question is why the hell would you want to. (Some may tell that I have frames/iframes with a passion
  3. I think it is more likely that you have include('common.php'); in more than one place - like it is included in a file which is included in common.php - what ever has happened ther is a second include of this file. One of the reasosn why require_once is what you shoudl really use for a site wide script liek this.
  4. php does just that... well teh browser does it regardless of the aqccepting script's language... providing you have set the name of the input like so... <input .... name="var[]"    .... it is not the difference in language here its the methdo of returning the variables if you have a few inputs named as above then you coudl access them in the accepting script like so.. print_r($_POST['var']); or foreach($_POST['var'] as $key => $val) { echo $key . " = " . $val; }
  5. you shoudl use isset because it is much more flexible when changing scripts.... perez nearly go it right... You can use isset for all the variables you need like so... [code]<?php if (   isset(         $_POST['email'],         $_POST['from'],         $_POST['contents']         )   ) { .... ?> [/code] Now as you can see if you need to add another variable that must be filled in it is mereley a case of adding the new var to the list in the isset construct. $_POST['email']) && isset($_POST['from']) && isset($_POST['contents'
  6. the one thing you are missing here is the data...... how are you going to ensure that the correct information has been sent? how are you going to ensure that it will be in the correct format? how are you going to ensure that something I haven't thought of here nd is important is not entered by the sender????? You can of course write a few regex's to pull data out provided that the sender has put stuff in like name: Bill company: Microsoft but what if they put (by accident) name: Microsoft company: Bill For this reason you would be best advised to use the methods that I or Andy suggest.
  7. you need to test the string... change thsi bit of ode so that the query string is in a var that you can print to screen... [code]<?php if($Submit){ // Get parameters from form. $id=$_POST['id']; $title=$_POST['title']; $content=$_POST['content']; $filename=$_POST['filename']; $qry = "update articles set title='$title', content='$content', filename='$filename' where id='$id'"; echo $qry; mysql_query($qry); //header("location:edit.php"); comment this to make sure your qry is echoed... //exit; } ?>[/code]
  8. too many queries in there!!!! [code] <?php // get the id from the POST array. This will be used latter $id = mysql_real_escape_string($_POST['id']); // remove the id from $_POST array. As we dont need it any more. unset($_POST['id']); $str = NULL; // now the fun starts! Put PHP into auto mode! foreach($_POST as $key => $value) { $value = !empty($value) ? "'" . mysql_real_escape_string($value) . "'" : "NULL"; $ftr .= is_null($str) ? "`" . $key . "` = "  . $value: ", `" . $key . "`= "  . $value; } $qry = mysql_query("UPDATE contactbook SET " . $str . " WHERE id='" . $id . "'"); ?> [/code]
  9. your best option is to send them a html formatted e-mail with e a form in it that they must complete and have teh action of that form point to a script n your site to process the info.
  10. I refer you to my previous post....
  11. echo out your query and run it in phpmyadmin - it will tell you if there is an error.  Alternatively the query will only 'work' if something is altered; if you try to update a record with the same data that is already there then affected rows will be 0
  12. may be a browser support issue there. compliant browsers would normally increase to bold.
  13. just use an anchor... <a href="http://google.com" target="_blank">view foobar</a>
  14. I would use a lovely tableless layout and css to get it working - as we all shoudl  ;) check css zen garden for inspiration
  15. neither of your cookies are called 'visited' - why set two cookies - decalre an aray of values in one cookie - much neater
  16. its a mess ;) use switch.... also use <?php echo $url; ?> instead just incase.... is that script from what should be in the iframe?
  17. the only thing ou will need for making the tables is array_multisort() As for users putting there results in... a nice little form and a script to put them into your database/xml or what ever you use. There are a million and one ways of doing this so saying anything more would be doing it for you - and you wouldn't learn anywhere near as much as by doing it yourself.
  18. you have the body tag before the include. session_start MUST come BEFORE you output any html/whitespace etc.....
  19. you could fork your script or do what everyone else does and just have an animated gif without any % loading.  The user is really only interested in teh fact that the browser isn't hanging so the gif still working away will satisfy them enough.
  20. post the code of the login script AND that of the page the header takes you to..
  21. EDITED BY WILDTEEN88: Please do not post illegal file sharing sites. Sorry... Try lynda.com
  22. $_SEREVER['PHP_SELF'] or $_SERVER['SCRIPT_NAME'] or $_SEREVER['FILE_NAME'] check out the super globals array to see merits of each
  23. Yeah.. you are still using $test1 in your query instead of $val!!!!!!!
  24. I think what you did before was a string replacement - in which case you would have to read the file contents into a string and perform teh string replace... If instead of leaving placeholders to perform teh replacement on, you could save you template files as php files and replace xxxPAGECONTENTxxx with <?php echo $pagecontent; ?>. Now in your script you coudl do.. $pagecontent = "A string grabbed from a databse or what ever."; require_once($_SERVER['DOCUMENT_ROOT'] . '/includes/cont_template.php'); obviously cont_template.php is the template file you have designed.......
×
×
  • 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.