Jump to content

Recommended Posts

Hey guys, I've been trying to make a proxy application with cURL, and I'm having trouble with structuring my code. I don't know how long to make it, and cURL is a bit difficult to understand. Here's a code, and if you can help me structure it, that would be great.

<html>
</head>
<body>
<center>
<form type=index.php name=proxy method=POST>
<input type=text name=bar width=300px>
<input type=submit name=search value=Proxy>
</form>
</center>
<?php
$sb=$_POST['bar']
$s=$_POST['search']
$ci=curl_init();
$ce=curl_exec();
$cc=curl_close();
curl_setopt($ci,CURLOPT_HEADER, true, ['proxy'];
$o=fopen
$0($sb)
$ci
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/179838-help-with-structuring-code/
Share on other sites

What you mean bro.

 

explain to us what you mean, slowly with good examples cheers.

 

we no, you want to understand order of code, but we don't get what wrong....

 

The order of code, is suppose to be from your coding order.

 

example.

 

//varable $name value as john.

 

$name="john";

 

//now i want to echo it.

echo $name.

 

my code order to set a variable and echo the result.

Let's start with this:

curl_setopt($ci,CURLOPT_HEADER, true, ['proxy'];
$o=fopen
$0($sb)
$ci

 

Don't know where you got it, but it's full of syntax errors.

 

Next:

$ci=curl_init();
$ce=curl_exec();
$cc=curl_close();

 

What are you trying to do here?

 

[added]

 

Did you see example here?

http://www.php.net/manual/en/curl.examples-basic.php

 

Here's what I'm trying to do. The user types the requested URL into the text bar, which then users cURL to locate the desired website. My question is, using cURL, what am I missing from this script, (syntax will be fixed) and what do I need to know to fix the problem. I have read the cURL manuals.

Did you read my post, if a web site has token ised there url, then you want get any info.

 

they might do it via cookies or sessions or ajax/javasript.

 

not all web sites allow content to be theft.

 

soon none will wait and see.

 

 

Mchi i am sure that the user will have to still learn to pattern

match via reg expression to get correct results?

 

That is correct, it's kind of like a sequence, and I'm always struggling to see which functions/plain out syntax, should go in the order they are in.

for example, should I run curl_exec or curl_init at the beginning, confusing to me. Mchi, I'm trying to learn PHP, the reason I jumped into cURL so early is for one reason is, I've been using some proxys to access my test server, and I thought it would be cool to make my own. My questions might be noobish, but bear with me please.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.