vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   help! (https://vborg.vbsupport.ru/showthread.php?t=62721)

AN-net 03-21-2004 03:01 AM

help!
 
ok i dont know y this script is not working.

PHP Code:

function button_exists($url)
{
    
$head "";
    
$url_p parse_url($url);
    if (isset(
$url_p["host"]))
    {
        
$host $url_p["host"];
    }
    else
    {
        return 
false;
    }
    if (isset(
$url_p["path"]))
    {
        
$path $url_p["path"];
    }
    else
    {
        
$path "";
    }
    
$fp fsockopen ($host80$errno$errstr20);
    if(!
$fp)
    {
        return 
false;
    }
    else
    {
        
$parse parse_url($url);
        
$host $parse['host'];
        
fputs($fp"HEAD ".$url." HTTP/1.1\r\n");
        
fputs($fp"HOST: ".$host."\r\n");
        
fputs($fp"Connection: close\r\n\r\n");
        
$headers "";
        while(!
feof ($fp))
        {
            
$headers .= fgets ($fp128);
        }
    }
fclose($fp);
    
$arr_headers explode("\n"$headers);
    
$return "false";
    if(isset(
$arr_headers[0]))
    {
        
$return strpos($arr_headers[0], "404") !== false;
    }
    return 
$return;


and heres the problem
PHP Code:

if(button_exists("$affiliate['buttonurl']")=="false"){
print 
"this button dont work!$affiliate['affiliate_id']";


im getting parse errors

filburt1 03-21-2004 03:05 PM

Quote:

Originally Posted by AN-net
im getting parse errors

And those parse errors are...? :)

AN-net 03-21-2004 04:54 PM

'T_STRING' or `T_VARIABLE' or `T_NUM_STRING'

filburt1 03-21-2004 05:44 PM

Quote:

Originally Posted by AN-net
'T_STRING' or `T_VARIABLE' or `T_NUM_STRING'

The entire parse error?

AN-net 03-21-2004 06:03 PM

Quote:

Originally Posted by evilphp
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/anima22/public_html/community/affiliate.php on line 210


Dean C 03-21-2004 06:11 PM

"$affiliate['buttonurl']"

You can't do that... remve the single quotes :)

AN-net 03-21-2004 06:15 PM

still getting same error

AN-net 03-21-2004 06:17 PM

got it working turns out i didnt know u cant use $var['blah'] inside quotes:)


All times are GMT. The time now is 06:22 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01031 seconds
  • Memory Usage 1,742KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete