Jump to content

jmilane

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jmilane's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [quote author=thorpe link=topic=109424.msg441010#msg441010 date=1159199004] Yeah sorry, that was a typo. Look at the bolded text.... <a href=\"http://www.mysite.com/script.php?[b]id[/b]=$lastid\">View Record</a> [/quote] Ooohhh... okay. Thanks. You are right of course.
  2. [quote author=thorpe link=topic=109424.msg440999#msg440999 date=1159198422] [code=php:0] $lastid = 32; echo "<a href=\"http://www.mysite.com/script.php?id=$lastid\">View Record</a>"; [/code] Notice the [b]id[/i]? [/quote] the [/i]??
  3. I want to email the equivalent of [code]<a href="http://www.mysite.com/script.php?=32">View Record</a>[/code] from within a php script where 32 is really a variable $lastid so I am trying [code]<a href=\"http://www.mysite.com/script.php?=$lastid\">View Record</a>;[/code] isnt working. help? thanks so much.
  4. [quote author=gerkintrigg link=topic=109413.msg440910#msg440910 date=1159193526] change <?PHP to <?php (lowercase) sometimes that causes problems [/quote] Thanks, but that wasnt it.
  5. [quote author=thorpe link=topic=109415.msg440924#msg440924 date=1159193906] A simple example. [code=php:0] <?php   if (isset($_GET['id'])) {     echo "You clicked foo";   } else {     echo "<a href='?id=foo'>foo</a>";   } ?> [/code] This is all within one page but should give you the idea. [/quote] So the $_GET var would be passed just in the url... like www.mysite.com/search?id=foo But then the file itself would simply be named www.mysite.com/search.php? And then the $_GET var would be whatever immediately follows the ? (in this case 'id'?) Thanks! Even if I am wrong...
  6. I want to send people a link that, when clicked, will open a php page which searches based on an id number. The id number will have to be appended to the end of the url. How do I set this up? Do I have to take the id number off of the url in the processing script and then incorporate it into a query? I know this probably has to do with the "?" in php URLs - but I am extremely new. Thank you.
  7. I have been at this for 3 hours... am I missing something obvious??? [code]<html> <head> <title> ULEM Registration Database Search Form </title> <body> <?PHP $username="ghf"; $password="gfghgfh"; $database="ghgfh"; $databox="www.ghfhgfh.org"; mysql_connect($databox,$username,$password); @mysql_select_db($database) or die("Unable to select database"); if (isset($_POST['regid'])) { $regid = $_POST['regid']; $query = "select employmentprog, businessprog, certprog, youthprog, parentprog, policyprog, firstname, middlename, lastname, birthdate, street, city, state, postalcode, homephone, otherphone, referral, contact, race, otherrace, gender, regdate from registration where id = $regid"; } if (isset($_POST['lastname'])) { $ln = $_POST['lastname']; $query = "select employmentprog, businessprog, certprog, youthprog, parentprog, policyprog, firstname, middlename, lastname, birthdate, street, city, state, postalcode, homephone, otherphone, referral, contact, race, otherrace, gender, regdate from registration where lastname = $ln"; } $result=mysql_query($query) or die(mysql_error());  $num=mysql_num_rows($result); if ($num == 0) {echo "No matching records."; return;} mysql_close(); echo "<b><center>The results of your search:</center></b><br><br>"; $i=0; while ($i < $num) { $firstname=mysql_result($result,$i,"firstname"); $middlename=mysql_result($result,$i,"middlename"); $lastname=mysql_result($result,$i,"lastname"); $homephone=mysql_result($result,$i,"homephone"); $otherphone=mysql_result($result,$i,"otherphone"); $street=mysql_result($result,$i,"street"); $city=mysql_result($result,$i,"city"); $state=mysql_result($result,$i,"state"); $postalcode=mysql_result($result,$i,"postalcode"); $referral=mysql_result($result,$i,"referral"); $race=mysql_result($result,$i,"race"); $otherrace=mysql_result($result,$i,"otherrace"); $contact=mysql_result($result,$i,"contact"); $gender=mysql_result($result,$i,"gender"); $regdate=mysql_result($result,$i,"regdate"); echo "<b>$firstname $lastname</b><br>Phone: $homephone<br>Other Phone: $otherphone<br>Street: $street<br>City: $city<br>Zip: $postalcode<br>Best time to contact $contact<br>Race: $race<br>Other race (if applicable): $otherrace<br>Gender: $gender<br>Registration date: $regdate<br><hr>"; $i++; } ?> </html>[/code]
  8. Hi, I have a mysql box that has a private network ip. The old developer was running our web server on this machine but the company since retired the box and it is in a closet, still running, but sad and alone, aliased as oldserver.mycompany.com. Now I am finding out that I need to use some of the funcitonality in the scripts that are on the old box. So, I just installed PHP on our new IIS webserver I have a form that he built which collects information from potential clients and then passes it on for entry in the database (on the old box), sends out emails, does calculations, and so on and so forth. It does a lot, actually. I cannot build a form to pass directly to this mysql box because it does not have a public IP. I cannot submit directly to a private IP. Found this out recently. So I tried to do something with cURL: [code] $ch = curl_init("http://oldserver.mycompany.com/somepage.php"); curl_setopt($ch, CURLOPT_POST); //use the POST method curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST); //take the $_POST array and use those as the POST parameters for the curl request curl_exec($ch); //execute the request [/code] But now I find out that CURLOPT_POSTFIELDS wants a string. Some of my $_POST variables are arrays. I think one is even an array of arrays. So now I have a new question... How can I go through $_POST and serialize() it, (is this even what I want to do??) and create a string that I can use with CURLOPT_POSTFIELDS? Mind you, I have been using PHP for a month If I am way off base, I sincerely apologize. I am also sincerely grateful for your time. I have been banging my head against the wall with this. Oh yeah... does PHP need to have cURL enabled on the machine that receives this request? Thanks a million... really... I feel awful asking this compound question. J
×
×
  • 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.