• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.
  • The forums have been upgraded with support for dark mode. By default it will follow the setting on your system/browser. You may override it by scrolling to the end of the page and clicking the gears icon.

need cURL help

Solaris17

Super Dainty Moderator
Staff member
Joined
Aug 16, 2005
Messages
27,894 (3.84/day)
Location
Alabama
System Name RogueOne
Processor Xeon W9-3495x
Motherboard ASUS w790E Sage SE
Cooling SilverStone XE360-4677
Memory 128gb Gskill Zeta R5 DDR5 RDIMMs
Video Card(s) MSI SUPRIM Liquid 5090
Storage 1x 2TB WD SN850X | 2x 8TB GAMMIX S70
Display(s) 49" Philips Evnia OLED (49M2C8900)
Case Thermaltake Core P3 Pro Snow
Audio Device(s) Moondrop S8's on Schitt Gunnr
Power Supply Seasonic Prime TX-1600
Mouse Razer Viper mini signature edition (mercury white)
Keyboard Wooting 80 HE White, Gateron Jades
VR HMD Quest 3
Software Windows 11 Pro Workstation
Benchmark Scores I dont have time for that.
Code:
‎/*
Link validator

Will use cURL to attempt to visit a webpage, and then return based upon how the
request was handled. Used for embedded videos to validate the ID is existant.

expects a link url as string
returns an array of three elements:
return_array[0] = HTTP version
return_array[1] = Returned error number (200, 404, etc)
return_array[2] = Returned error text ("OK", "File Not Found", etc) */
function check_link($link) {
$main = array();
[COLOR="Red"]$ch = curl_init();[/COLOR]
curl_setopt ($ch, CURLOPT_URL, $link);
curl_setopt ($ch, CURLOPT_HEADER, 1);
curl_setopt ($ch, CURLOPT_NOBODY, 1);
//	curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_TIMEOUT, 10);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 

5.0)");
ob_start();
curl_exec ($ch);
$stuff = ob_get_contents();
ob_end_clean();
curl_close ($ch);
$parts = split("n",$stuff,2);
$main = split(" ",$parts[0],3);
return $main;
}

Error is

Fatal error: Call to undefined function curl_init() in C:\X\posts.php on line 198

WAT do? This is video embed code. When submiting I am given that error.
 
look at line 198 on your posts.php file and see what it is
 
so is this a php script using the curl module?
 
thanks guys forgot to install curl man I feel retarded will get back with results.
 
worked thanks guys. installed cURL removed the ";" from curl.dll (in php.ini) and all is well in the forest.
 
Back
Top