Jump to content

Wallboy

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Wallboy's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. No, I have a form on MY server that contains text,file inputs. I'm making a script that can submit post values to the form php automatically where it currently gets values from a txt file such as the name and description and then grabs the next line in the txt with the new value and repeats. I was wondering if I would have to upload the files to my server first and then somehow use libcurl to read each of those files and include those in the loop. Or if it was even possible to grab the file on my local computer without using the windows browser(which I don't think is possible?)
  2. Hello, I'm wondering if it's possible to send a file through post using libcurl without having to use the browse button and manually selecting the file? And also would this only be possible if the file exists on the remote server, or is it possible to access a local drive to grab the file and upload temporarily and send over post? I'm trying to create a script that will automate a form with various text inputs and a I'm stuck on how with files. How can I achieve this? Thanks!
  3. Scratch that lost post, didn't see that you changed the code... used the code you changed to and everything works perfect now. Thanks guys!
  4. Same error, changed to: <?php $dblink = mysql_connect("localhost","username", "password") or die('Error: '.mysql_error ()); mysql_select_db("database"); $result = mysql_query("select * from tablename where sku=$_GET['sku']") or die('Error: '.mysql_error ()); $row = mysql_fetch_array($result); $link = $row["link"]; mysql_query("update tablename set clicks=clicks+1 where sku=$_GET['sku']"); header("Location: $link"); mysql_free_result($result); mysql_close($dblink); ?>
  5. <?php $dblink = mysql_connect("localhost","username", "password") or die('Error: '.mysql_error ()); mysql_select_db("database"); $result = mysql_query("select * from tablename where sku=''$_GET['sku']''") or die('Error: '.mysql_error ()); $row = mysql_fetch_array($result); $link = $row["link"]; mysql_query("update tablename set clicks=clicks+1 where sku=''$_GET['sku']''"); header("Location: $link"); mysql_free_result($result); mysql_close($dblink); ?> This returns the following error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/digitall/public_html/redirect.php on line 5
  6. Where in the script would I place this?
  7. Alright I have an affiliate site and I'm trying to cloak my affiliate links by using a PHP redirect. So basically my script takes the following info redirect.php?sku=EXAMPLE and then goes into a database and finds the SKU number and then grabs the actual link in that row and sends the user there. Here's what I have so far. <?php $dblink = mysql_connect("localhost","username", "pwd") or die('Error: '.mysql_error ()); mysql_select_db("database"); $result = mysql_query("select * from tablename where sku='$sku'") or die('Error: '.mysql_error ()); $row = mysql_fetch_array($result); $link = $row["link"]; mysql_query("update tablename set clicks=clicks+1 where sku='$sku'"); header("Location: $link"); mysql_free_result($result); mysql_close($dblink); ?> Now I have a few test fields I added to the database to test it out before I import my actual data to it. The three fields I have in my database are sku, link, and clicks(I'm also trying to monitor the clicks on that link which isn't working either). Currently the script just brings me to a blank page. If I change the header line to an explicit link such as header("Location: http://www.example.com/"); It goes to that domain. So whats wrong in the script? Thanks!
×
×
  • 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.